Selaa lähdekoodia

Update PronounService, fix jsonn_decode null parameter

Daniel Supernault 2 vuotta sitten
vanhempi
commit
d72cd819d2
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      app/Services/PronounService.php

+ 1 - 1
app/Services/PronounService.php

@@ -15,7 +15,7 @@ class PronounService {
 
 
 		return Cache::remember($key, $ttl, function() use($id) {
 		return Cache::remember($key, $ttl, function() use($id) {
 			$res = UserPronoun::whereProfileId($id)->first();
 			$res = UserPronoun::whereProfileId($id)->first();
-			return $res ? json_decode($res->pronouns, true) : [];
+			return $res && $res->pronouns ? json_decode($res->pronouns, true) : [];
 		});
 		});
 	}
 	}