editorconfig / editorconfig-visualstudio

EditorConfig Visual Studio Addin
http://editorconfig.org
Other
353 stars 75 forks source link

Fix NullReferenceException error for pathless files #48

Closed takeshik closed 7 years ago

takeshik commented 7 years ago

Overview

When the new VS Text Editor is opened with some special output (e.g. Stack Trace Explorer in ReSharper), it has no path, so the argument path in SettingsExtensions.TryLoad is null, and NullReferenceException is thrown in parser.Parse(string). So null-check must be needed.

Repro

  1. Install both EditorConfig extension and ReSharper (an example) in Visual Studio instance.
  2. Open Stack Trace Explorer in ReSharper. Parsed stack trace are shown in [Stack Trace Explorer] pane.
  3. But suddenly [Error List] pane is shown with EditorConfig extension's NullReferenceException.
Mpdreamz commented 7 years ago

LGTM 👍