You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
V3019 Possibly an incorrect variable is compared to null after type conversion using 'as' keyword. Check variables 'value', 'valueExpression'. ExpressionMatcher.cs 62
publicboolMatches(objectvalue){varvalueExpression= value as Expression;if(value==null)//<=={returnfalse;}return ExpressionComparer.Default.Equals(this.expression, valueExpression);}
It is most likely the object of the derived class that the programmer intended to check for null before using it. This is the fixed version of the code:
publicboolMatches(objectvalue){varvalueExpression= value as Expression;if(valueExpression==null){returnfalse;}return ExpressionComparer.Default.Equals(this.expression, valueExpression);}
This place is found by a static analyzer PVS-Studio.
The text was updated successfully, but these errors were encountered:
stakx
added a commit
to stakx/moq
that referenced
this issue
May 31, 2017
V3019 Possibly an incorrect variable is compared to null after type conversion using 'as' keyword. Check variables 'value', 'valueExpression'. ExpressionMatcher.cs 62
It is most likely the object of the derived class that the programmer intended to check for null before using it. This is the fixed version of the code:
This place is found by a static analyzer PVS-Studio.
The text was updated successfully, but these errors were encountered: