Browse Source

FIX: Service-> fixed blinkon/off when null list passed.

Giancarlo Voci 7 years ago
parent
commit
02711e67de
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/OpenMind/FindBox/FindBoxService.php

+ 4 - 0
src/OpenMind/FindBox/FindBoxService.php

@@ -322,6 +322,10 @@ class FindBoxService
 					case QueueCommand::$Q_BLINK_ON:
 					case QueueCommand::$Q_BLINK_ON:
 					case QueueCommand::$Q_BLINK_OFF:
 					case QueueCommand::$Q_BLINK_OFF:
 						// Split blink list by 9 items each array
 						// Split blink list by 9 items each array
+						if ($clientCommands->id == null) {
+							$this->ServiceLogger->write("No labels passed to BLINK_ON/OFF command code '{$clientCommands}'", 'd/m/Y H:i:s');
+							return NULL;
+						}
 						$labelsSplitted = array_chunk($clientCommands->id, 9);
 						$labelsSplitted = array_chunk($clientCommands->id, 9);
 						foreach($labelsSplitted as $labels) {
 						foreach($labelsSplitted as $labels) {
 							$cmd = clone $clientCommands;
 							$cmd = clone $clientCommands;