I like all the inspections in WebStorm, which help me clean up my code and find potential issues. But I fail to understand some warnings and they are getting into my way.
For example in the screenshot below you can see that I explicitly check if the variable result
is null
, and if so, assign an empty array to it. However, just below that WebStorm gives me a warning that the variable result
is possibly null.
What is going on here? Do I have to clear a cache or is this simply a bug in WebStorm's inspections? Or am I missing something completely and the Warning is justified?
Edit: If this is a bug, it might be helpful to know that the variable is explicitly set to null
on declaration (let result = null;
).
Submitted to developers, please vote for WEB-48756 to be notified on any progress with it