From 69dcbe18fa3854f08d97ec661309c61c5296459e Mon Sep 17 00:00:00 2001 From: horus Date: Sun, 28 Feb 2021 19:17:49 +0100 Subject: handles non existing mal user --- app/Libraries/Helper.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/Libraries/Helper.php') diff --git a/app/Libraries/Helper.php b/app/Libraries/Helper.php index 9f0ca2d..71e3cea 100644 --- a/app/Libraries/Helper.php +++ b/app/Libraries/Helper.php @@ -161,7 +161,11 @@ class Helper { $actually_watching = array(); - foreach( $user->getIsWatching() as $anime_details ) { + $anime = $user->getIsWatching(); + if ( false === $anime ) + return false; + + foreach( $anime as $anime_details ) { $check = DB::table('is_watching') ->where('mal_id', $anime_details["mal_id"]) ->where('user_id', $user->id) -- cgit v1.2.3