This website uses cookies and other technology to provide you a more personalized
experience. By
continuing the view of our web-pages you accept the terms of using these files. If you
don't
want your personal data to be processed, please, leave this site.
Learn More →
Examples of errors detected by the V3148 diagnostic
V3148. Casting potential 'null' value to a value type can lead to NullReferenceException.
RunUO
V3148 Casting potential 'null' value of 'toSet' to a value type can lead to NullReferenceException. Properties.cs 502
public static string ConstructFromString( .... )
{
object toSet;
bool isSerial = IsSerial( type );
if ( isSerial ) // mutate into int32
type = m_NumericTypes[4];
....
else if ( value == null )
{
toSet = null;
}
....
if ( isSerial ) // mutate back
toSet = (Serial)((Int32)toSet);
constructed = toSet;
return null;
}