瀏覽代碼

Fix iconStoreService get() not returning null on missing file

Bubka 8 月之前
父節點
當前提交
2b35a9543a
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      app/Services/IconStoreService.php

+ 5 - 3
app/Services/IconStoreService.php

@@ -129,9 +129,11 @@ class IconStoreService
      */
     public function get(string $name) : ?string
     {
-        return $this->usesDatabase
-            ? Icon::find($name)?->content
-            : $this->disk()->get($name);
+        if ($this->usesDatabase) {
+            return Icon::find($name)?->content;
+        } else {
+            return $this->disk()->get($name) ?: null;
+        }
     }
 
     /**