Prevent ArgumentNullException in refresh request (#963)

This commit is contained in:
Soheil Alizadeh
2020-06-14 23:24:31 -07:00
committed by GitHub
parent 28e479f239
commit 31659e1126
2 changed files with 29 additions and 9 deletions
@@ -243,7 +243,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
string uri = refreshParams.SessionId;
ObjectExplorerSession session = null;
if (!sessionMap.TryGetValue(uri, out session))
if (string.IsNullOrEmpty(uri) || !sessionMap.TryGetValue(uri, out session))
{
Logger.Write(TraceEventType.Verbose, $"Cannot expand object explorer node. Couldn't find session for uri. {uri} ");
await serviceHost.SendEvent(ExpandCompleteNotification.Type, new ExpandResponse