Skip to content

Commit 604439c

Browse files
committed
Fix NullReferenceException error for pathless files
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` is null, and NullReferenceException is thrown in parser.Parse(string). So null-check must be needed.
1 parent 1863c74 commit 604439c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/EditorConfig.VisualStudio/Helpers/SettingsExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal static class ConfigLoader
1111
public static bool TryLoad(string path, out FileConfiguration fileConfiguration)
1212
{
1313
fileConfiguration = null;
14+
if (string.IsNullOrEmpty(path)) return false;
1415
var parser = new EditorConfigParser();
1516
var configurations = parser.Parse(path);
1617
if (!configurations.Any()) return false;

0 commit comments

Comments
 (0)