Przeglądaj źródła

if(is_object($value)){

visuddhinanda 2 lat temu
rodzic
commit
a885261978
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      app/Http/Controllers/PaliTextController.php

+ 4 - 2
app/Http/Controllers/PaliTextController.php

@@ -202,8 +202,10 @@ class PaliTextController extends Controller
         if($chapters){
             if($request->get('view') !== 'book-toc'){
                 foreach ($chapters as $key => $value) {
-                    $progress_key="/chapter_dynamic/{$value->book}/{$value->paragraph}/global";
-                    $chapters[$key]->progress_line = Cache::get($progress_key);
+                    if(is_object($value)){
+                        $progress_key="/chapter_dynamic/{$value->book}/{$value->paragraph}/global";
+                        $chapters[$key]->progress_line = Cache::get($progress_key);
+                    }
                 }
             }
             return $this->ok(["rows"=>$chapters,"count"=>$all_count]);