mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Fix nullref in object timeout
This commit is contained in:
@@ -275,7 +275,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
CreateSessionTask = task;
|
||||
Task.Run(async () =>
|
||||
{
|
||||
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task, settings.CreateSessionTimeout);
|
||||
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task,
|
||||
settings?.CreateSessionTimeout ?? ObjectExplorerSettings.DefaultCreateSessionTimeout);
|
||||
|
||||
if (result != null && !result.IsComplete)
|
||||
{
|
||||
cancellationTokenSource.Cancel();
|
||||
@@ -419,7 +421,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
ExpandTask = task;
|
||||
Task.Run(async () =>
|
||||
{
|
||||
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task, settings.ExpandTimeout);
|
||||
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task,
|
||||
settings?.ExpandTimeout ?? ObjectExplorerSettings.DefaultExpandTimeout);
|
||||
|
||||
if (result != null && !result.IsComplete)
|
||||
{
|
||||
cancellationTokenSource.Cancel();
|
||||
|
||||
@@ -10,10 +10,13 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
||||
/// </summary>
|
||||
public class ObjectExplorerSettings
|
||||
{
|
||||
public static int DefaultCreateSessionTimeout = 10;
|
||||
public static int DefaultExpandTimeout = 10;
|
||||
|
||||
public ObjectExplorerSettings()
|
||||
{
|
||||
CreateSessionTimeout = 10;
|
||||
ExpandTimeout = 10;
|
||||
CreateSessionTimeout = DefaultCreateSessionTimeout;
|
||||
ExpandTimeout = DefaultExpandTimeout;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user