Fixes null propogation
This commit is contained in:
parent
22ab83ea9e
commit
3c9842ee5a
218 changed files with 799 additions and 1458 deletions
|
|
@ -110,8 +110,8 @@ namespace Server.Misc
|
|||
if (Settings.KickOnFailure)
|
||||
m.Send(new BeginHandshake());
|
||||
|
||||
if (m_Dictionary.TryGetValue(m, out Timer t) && t != null)
|
||||
t.Stop();
|
||||
if (m_Dictionary.TryGetValue(m, out Timer t))
|
||||
t?.Stop();
|
||||
|
||||
m_Dictionary[m] = t = Timer.DelayCall(Settings.HandshakeTimeout, OnHandshakeTimeout_Callback, m);
|
||||
t.Start();
|
||||
|
|
|
|||
|
|
@ -513,11 +513,9 @@ namespace Server
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( first != null )
|
||||
first.Delete();
|
||||
first?.Delete();
|
||||
|
||||
if ( second != null )
|
||||
second.Delete();
|
||||
second?.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -539,11 +537,9 @@ namespace Server
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( first != null )
|
||||
first.Delete();
|
||||
first?.Delete();
|
||||
|
||||
if ( second != null )
|
||||
second.Delete();
|
||||
second?.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -257,10 +257,7 @@ namespace Server.Misc
|
|||
{
|
||||
Mobile mob = acc[i];
|
||||
|
||||
if ( mob == null )
|
||||
continue;
|
||||
|
||||
string lang = mob.Language;
|
||||
string lang = mob?.Language;
|
||||
|
||||
if ( lang != null )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ namespace Server
|
|||
NetState ns = NetState.Instances[i];
|
||||
Mobile m = ns.Mobile;
|
||||
|
||||
if ( m != null )
|
||||
m.CheckLightLevels( false );
|
||||
m?.CheckLightLevels( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -113,8 +112,7 @@ namespace Server
|
|||
NetState ns = NetState.Instances[i];
|
||||
Mobile m = ns.Mobile;
|
||||
|
||||
if ( m != null )
|
||||
m.CheckLightLevels( false );
|
||||
m?.CheckLightLevels( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@ namespace Server.Misc
|
|||
{
|
||||
NetState ns = from.NetState;
|
||||
|
||||
if ( ns != null )
|
||||
ns.Dispose();
|
||||
ns?.Dispose();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,10 +131,7 @@ namespace Server
|
|||
|
||||
public static implicit operator string( TextDefinition m )
|
||||
{
|
||||
if ( m == null )
|
||||
return null;
|
||||
|
||||
return m.m_String;
|
||||
return m?.m_String;
|
||||
}
|
||||
|
||||
public static void AddHtmlText( Gump g, int x, int y, int width, int height, TextDefinition def, bool back, bool scroll, int numberColor, int stringColor )
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@ namespace Server
|
|||
|
||||
public static void Initialize()
|
||||
{
|
||||
if ( StartValidation != null )
|
||||
StartValidation();
|
||||
StartValidation?.Invoke();
|
||||
|
||||
StartValidation = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,8 +198,7 @@ namespace Server.Misc
|
|||
|
||||
List<Weather> list = GetWeatherList( facet );
|
||||
|
||||
if ( list != null )
|
||||
list.Add( this );
|
||||
list?.Add( this );
|
||||
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( (0.2+(Utility.RandomDouble()*0.8)) * interval.TotalSeconds ), interval, new TimerCallback( OnTick ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue