From 8d56949800df0c11df4e37df98f540539d32449e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 28 Sep 2022 18:36:47 -0400 Subject: [PATCH] Deal with structure of json response from API when getting Janus_Pin --- web/includes/Monitor.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php index b48687b7e..f918a7ba2 100644 --- a/web/includes/Monitor.php +++ b/web/includes/Monitor.php @@ -279,9 +279,8 @@ public static function getStatuses() { return $output ? trim($output) : $output; } else if ($this->ServerId()) { $result = $this->Server()->SendToApi('/monitors/'.$this->{'Id'}.'.json'); - Debug(print_r($result, true)); $json = json_decode($result, true); - return $json['Janus_Pin']; + return ((isset($json['monitor']) and isset($json['monitor']['Monitor']) and isset($json['monitor']['Monitor']['Janus_Pin'])) ? $json['monitor']['Monitor']['Janus_Pin'] : ''); } else { Error('Server not assigned to Monitor in a multi-server setup. Please assign a server to the Monitor.'); }