diff options
| author | horus | 2021-02-28 19:17:49 +0100 |
|---|---|---|
| committer | horus | 2021-02-28 19:17:49 +0100 |
| commit | 69dcbe18fa3854f08d97ec661309c61c5296459e (patch) | |
| tree | 9cf3cac4569098a4f90ef7e86d55851f2417ecf4 /app/Libraries/Helper.php | |
| parent | 522f1dd6c21d716be635484d11cd814172949f2b (diff) | |
| download | senpai-69dcbe18fa3854f08d97ec661309c61c5296459e.tar.gz | |
handles non existing mal user
Diffstat (limited to 'app/Libraries/Helper.php')
| -rw-r--r-- | app/Libraries/Helper.php | 6 |
1 files changed, 5 insertions, 1 deletions
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) |
