From 5f4a1f768e7ff14cca412b3219855a7bbf300ecc Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 8 Apr 2025 13:32:50 -0500 Subject: [PATCH] fix: check for grant code in mobileadduiclient If the grant code was not provided, the `mobileadduiclient` console command would fail silently. The command now checks that the correct number of arguments was provided and prints an error to the console of one is missing --- .../WebSocketServer/MobileControlWebsocketServer.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PepperDash.Essentials.MobileControl/WebSocketServer/MobileControlWebsocketServer.cs b/src/PepperDash.Essentials.MobileControl/WebSocketServer/MobileControlWebsocketServer.cs index 8cf96cc5..cd75dcb7 100644 --- a/src/PepperDash.Essentials.MobileControl/WebSocketServer/MobileControlWebsocketServer.cs +++ b/src/PepperDash.Essentials.MobileControl/WebSocketServer/MobileControlWebsocketServer.cs @@ -679,6 +679,14 @@ namespace PepperDash.Essentials.WebSocketServer } var values = s.Split(' '); + + if(values.Length < 2) + { + CrestronConsole.ConsoleCommandResponse("Invalid number of arguments. Please provide a room key and a grant code"); + return; + } + + var roomKey = values[0]; var grantCode = values[1];