From 8c817ac2f3b51cf83542e6ac0439ee852bb32e4f Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Tue, 1 Aug 2023 15:28:20 +0700 Subject: [PATCH] Fix handling default value --- app/Http/Controllers/ActivityController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 708b3a5..978276d 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -462,8 +462,12 @@ class ActivityController extends Controller do { array_pop($activityStack); $lastStack = end($activityStack); - if ($activity->level > $lastStack->level) + if ($lastStack) { + if ($activity->level > $lastStack->level) + $lastStackIsNotRight = false; + } else { $lastStackIsNotRight = false; + } } while ($lastStackIsNotRight); }