Prechádzať zdrojové kódy

Fix iconStoreService get() not returning null on missing file

Bubka 9 mesiacov pred
rodič
commit
2b35a9543a
1 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  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;
+        }
     }
 
     /**