@ -462,8 +462,12 @@ class ActivityController extends Controller
do {
array_pop($activityStack);
$lastStack = end($activityStack);
if ($activity->level > $lastStack->level)
if ($lastStack) {
$lastStackIsNotRight = false;
} else {
}
} while ($lastStackIsNotRight);