浏览代码

Update PronounService, fix jsonn_decode null parameter

Daniel Supernault 2 年之前
父节点
当前提交
d72cd819d2
共有 1 个文件被更改,包括 1 次插入1 次删除
  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) : [];
 		});
 	}