Avoid null reference exceptions in diagnostics parsing (#149)

* Avoid a couple possible null reference exceptions

* Switch syntax around a little bit.
This commit is contained in:
Karl Burtram
2016-11-17 15:06:57 -08:00
committed by GitHub
parent c2ffd4c2a5
commit a54d081363

View File

@@ -877,6 +877,8 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
// build a list of SQL script file markers from the errors
List<ScriptFileMarker> markers = new List<ScriptFileMarker>();
if (parseResult != null && parseResult.Errors != null)
{
foreach (var error in parseResult.Errors)
{
markers.Add(new ScriptFileMarker()
@@ -895,6 +897,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
}
});
}
}
return markers.ToArray();
}