mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix bogus nullability errors from Rider.
None of these are actual nullability warnings but they make Rider shut up so.
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Robust.Client.Graphics.Clyde
|
||||
foreach (var tile in chunk)
|
||||
{
|
||||
var regionMaybe = _tileDefinitionManager.TileAtlasRegion(tile.Tile);
|
||||
if (!regionMaybe.HasValue)
|
||||
if (regionMaybe == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ namespace Robust.Client.UserInterface.Controls
|
||||
else
|
||||
{
|
||||
var metrics = font.GetCharMetrics(chr, UIScale);
|
||||
if (!metrics.HasValue)
|
||||
if (metrics == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace Robust.Shared.Prototypes
|
||||
|
||||
foreach (var (stream, filePath) in yamlStreams)
|
||||
{
|
||||
for (var i = 0; i < stream.Documents.Count; i++)
|
||||
for (var i = 0; i < stream!.Documents.Count; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace Robust.Shared.Serialization
|
||||
/// </exception>
|
||||
public virtual T ReadDataField<T>(string name)
|
||||
{
|
||||
if (TryReadDataField(name, out T val))
|
||||
if (TryReadDataField<T>(name, out var val))
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace Robust.Shared.Serialization
|
||||
{
|
||||
if (Reading) // read
|
||||
{
|
||||
if (_context != null && _context.TryGetCachedField(name, out T theValue))
|
||||
if (_context != null && _context.TryGetCachedField<T>(name, out var theValue))
|
||||
{
|
||||
// Itermediate field so value doesn't get reset to default(T) if this fails.
|
||||
value = theValue;
|
||||
@@ -256,7 +256,7 @@ namespace Robust.Shared.Serialization
|
||||
{
|
||||
if (Reading)
|
||||
{
|
||||
if (_context != null && _context.TryGetCachedField(name, out TTarget theValue))
|
||||
if (_context != null && _context.TryGetCachedField<TTarget>(name, out var theValue))
|
||||
{
|
||||
// Itermediate field so value doesn't get reset to default(T) if this fails.
|
||||
value = theValue;
|
||||
@@ -307,7 +307,7 @@ namespace Robust.Shared.Serialization
|
||||
throw new InvalidOperationException("Cannot use ReadDataField while not reading.");
|
||||
}
|
||||
|
||||
if (_context != null && _context.TryGetCachedField(name, out T val))
|
||||
if (_context != null && _context.TryGetCachedField<T>(name, out var val))
|
||||
{
|
||||
return val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user