diff --git a/caching_model.php b/caching_model.php index 4a0a434..5fc35bc 100755 --- a/caching_model.php +++ b/caching_model.php @@ -206,7 +206,8 @@ public function process($data) // Traverse the caching object with translations foreach ($translate as $search => $field) { - if (! is_array($cachingjson[0]["result"])){ + //if (! is_array($cachingjson[0]["result"])){ + if (! is_array($cachingjson) || ! is_array($cachingjson[0]["result"] ?? false )) continue; { // If not an array, null the field $this->$field = ''; @@ -262,7 +263,8 @@ public function process($data) $this->create(); // Process exact_metrics, if it exists - if($cachingjson[0]["result"]['exact_metrics']){ + //if($cachingjson[0]["result"]['exact_metrics']){ + if(isset($cachingjson[0]["result"])) if($cachingjson[0]["result"]['exact_metrics']){ $pastThirtyone = (time()-2678400); // Split entries into array $exact_array = explode("__", $cachingjson[0]["result"]['exact_metrics']); @@ -357,3 +359,4 @@ public function process($data) } } // End process() } +