Skip to content

Commit 4b7abfa

Browse files
committed
minor issues fixes from Jo Surikat
1 parent 75f260a commit 4b7abfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Storage.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function readPackage(AssetPackage $package)
105105
$name = $package->getNormalName();
106106
$path = $this->buildHashedPath($name);
107107
if (!file_exists($path)) {
108-
return [];
108+
return null;
109109
}
110110
$json = file_get_contents($path);
111111
$updateTime = filemtime($path);
@@ -135,7 +135,7 @@ protected function writeProviderLatest($name, $hash)
135135
if (file_exists($latest_path)) {
136136
$data = Json::decode(file_get_contents($latest_path) ?: '[]');
137137
}
138-
if (!is_array($data)) {
138+
if (!isset($data) || !is_array($data)) {
139139
$data = [];
140140
}
141141
if (!isset($data['providers'])) {

0 commit comments

Comments
 (0)