Reporter | 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.
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.