Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-287206: Incorrect detection of Possible InvalidOperationException (Resharper 6.0)

$
0
0
Reporter Al Baymar (Al.Baymar) Al Baymar (Al.Baymar)
Created Dec 20, 2011 11:44:32 PM
Updated Jan 10, 2012 8:19:47 PM
Priority Normal
Type Bug
Fix versions Mirabile Futurum
State Open
Assignee Evgeny Pasynkov (pasynkov)
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
Resharper claims that code below can potentially cause an exception at context.CurrentPosition.Value use due to context.CurrentPosition set to null:

if ((context.TextAlign & TA_UPDATECP) == TA_UPDATECP && context.CurrentPosition == null)
{
return new Rectangle(textLine.Origin, textLine.Size);
}

Rectangle textLocation = (context.TextAlign & TA_UPDATECP) == TA_UPDATECP
? new Rectangle(context.CurrentPosition.Value, textLine.Size)
: new Rectangle(textLine.Origin, textLine.Size);

This is an obviously incorrect claim.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>