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

RSRP-289614: Extract Variable can cause NullReferenceException

$
0
0
Reporter Drew Noakes (drewnoakes) Drew Noakes (drewnoakes)
Created Mar 8, 2012 11:01:14 PM
Updated Mar 8, 2012 11:01:14 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions 6.1
Fixed in build No Fixed in build
if (_a == null || _a.Foo != 0) {
  Blah(_a.Foo);
}
Blag(_a.Foo);


Extract variable on _a.Foo suggests 'Replace 3 usages' which breaks code with NRE:


var foo = _a.Foo;
if (_a == null || foo != 0) {
  Blah(foo);
}
Blag(foo);


R# should at least warn about this.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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