fixes issue with optional timeout parameter

This commit is contained in:
Andrew Welker
2020-06-12 08:18:56 -06:00
parent 625c870072
commit 26bd0d624e

View File

@@ -313,7 +313,13 @@ namespace PepperDash.Essentials.Core
var deviceKey = args[0]; var deviceKey = args[0];
var setting = args[1]; var setting = args[1];
var timeout = args[2];
var timeout= String.Empty;
if (args.Length >= 3)
{
timeout = args[2];
}
var device = GetDeviceForKey(deviceKey) as IStreamDebugging; var device = GetDeviceForKey(deviceKey) as IStreamDebugging;
@@ -322,9 +328,8 @@ namespace PepperDash.Essentials.Core
Debug.Console(0, "Unable to get device with key: {0}", deviceKey); Debug.Console(0, "Unable to get device with key: {0}", deviceKey);
return; return;
} }
else
{ eStreamDebuggingSetting debugSetting;
eStreamDebuggingSetting debugSetting = eStreamDebuggingSetting.Off;
try try
{ {
@@ -349,7 +354,6 @@ namespace PepperDash.Essentials.Core
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "Unable to convert minutes or settings value. Please use an integer value for minutes. Errro: {0}", e); Debug.Console(0, "Unable to convert minutes or settings value. Please use an integer value for minutes. Errro: {0}", e);
return;
} }
} }
else else
@@ -357,8 +361,6 @@ namespace PepperDash.Essentials.Core
device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting); device.StreamDebugging.SetDebuggingWithDefaultTimeout(debugSetting);
Debug.Console(0, "Device: '{0}' debug level set to {1) for default time (30 minutes)", deviceKey, debugSetting); Debug.Console(0, "Device: '{0}' debug level set to {1) for default time (30 minutes)", deviceKey, debugSetting);
} }
}
} }
/// <summary> /// <summary>