Prevent ArgumentNullException in refresh request (#963)

This commit is contained in:
Soheil Alizadeh
2020-06-15 10:54:31 +04:30
committed by GitHub
parent 28e479f239
commit 31659e1126
2 changed files with 29 additions and 9 deletions

View File

@@ -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