mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
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:
@@ -877,6 +877,8 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
|||||||
|
|
||||||
// build a list of SQL script file markers from the errors
|
// build a list of SQL script file markers from the errors
|
||||||
List<ScriptFileMarker> markers = new List<ScriptFileMarker>();
|
List<ScriptFileMarker> markers = new List<ScriptFileMarker>();
|
||||||
|
if (parseResult != null && parseResult.Errors != null)
|
||||||
|
{
|
||||||
foreach (var error in parseResult.Errors)
|
foreach (var error in parseResult.Errors)
|
||||||
{
|
{
|
||||||
markers.Add(new ScriptFileMarker()
|
markers.Add(new ScriptFileMarker()
|
||||||
@@ -895,6 +897,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return markers.ToArray();
|
return markers.ToArray();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user