Use Null-Propagation Operator
This commit is contained in:
@@ -111,8 +111,7 @@ namespace OpenRA
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (mapPackage != null)
|
||||
mapPackage.Dispose();
|
||||
mapPackage?.Dispose();
|
||||
Console.WriteLine("Failed to load map: {0}", map);
|
||||
Console.WriteLine("Details: {0}", e);
|
||||
Log.Write("debug", "Failed to load map: {0}", map);
|
||||
@@ -192,8 +191,7 @@ namespace OpenRA
|
||||
foreach (var p in maps.Values)
|
||||
p.UpdateRemoteSearch(MapStatus.Unavailable, null);
|
||||
|
||||
if (queryFailed != null)
|
||||
queryFailed();
|
||||
queryFailed?.Invoke();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -213,8 +211,7 @@ namespace OpenRA
|
||||
{
|
||||
Log.Write("debug", "Can't parse remote map search data:\n{0}", data);
|
||||
Log.Write("debug", "Exception: {0}", e);
|
||||
if (queryFailed != null)
|
||||
queryFailed();
|
||||
queryFailed?.Invoke();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -298,8 +295,7 @@ namespace OpenRA
|
||||
Game.RunAfterTick(() =>
|
||||
{
|
||||
// Wait for any existing thread to exit before starting a new one.
|
||||
if (previewLoaderThread != null)
|
||||
previewLoaderThread.Join();
|
||||
previewLoaderThread?.Join();
|
||||
|
||||
previewLoaderThread = new Thread(LoadAsyncInternal)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user