Browse Source

Update PronounService, fix jsonn_decode null parameter

Daniel Supernault 2 years ago
parent
commit
d72cd819d2
1 changed files with 1 additions and 1 deletions
  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) {
 			$res = UserPronoun::whereProfileId($id)->first();
-			return $res ? json_decode($res->pronouns, true) : [];
+			return $res && $res->pronouns ? json_decode($res->pronouns, true) : [];
 		});
 	}