diff --git a/app/modules/deploystudio/lib/deploystudio_helper.php b/app/modules/deploystudio/lib/deploystudio_helper.php index b4a9e13b3..1c64add55 100644 --- a/app/modules/deploystudio/lib/deploystudio_helper.php +++ b/app/modules/deploystudio/lib/deploystudio_helper.php @@ -24,7 +24,7 @@ public function pull_deploystudio_data(&$deploystudio_model) // Get computer data from DeployStudio $url = "{$deploystudio_server}/computers/get/entry?id={$deploystudio_model->serial_number}"; $deploystudio_computer_result = $this->get_deploystudio_url($url); - + if(! $deploystudio_computer_result){ throw new Exception("No data received from deploystudio server", 1); } @@ -34,6 +34,10 @@ public function pull_deploystudio_data(&$deploystudio_model) $plist->parse($deploystudio_computer_result); $plist = $plist->toArray(); + if( ! $plist){ + throw new Exception("Machine not found in deploystudio server", 1); + } + $plist = array_values($plist); $plist = $plist[0];