Skip to content

Commit b274469

Browse files
authored
fix bug that hostCache could be null
1 parent 2f924ad commit b274469

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Qiniu/Zone.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ private function hostCacheFromFile()
140140
}
141141

142142
$bucketHosts = file_get_contents($path);
143-
$this->hostCache = json_decode($bucketHosts, true);
143+
$hostCache = json_decode($bucketHosts, true);
144+
$this->hostCache = is_null($hostCache) ? [] : $hostCache;
144145
return;
145146
}
146147

0 commit comments

Comments
 (0)