Skip to content

Commit 20a9155

Browse files
authored
Merge pull request #209 from silentred/patch-2
fix bug that hostCache could be null
2 parents c23e7d9 + b30c548 commit 20a9155

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) ? array() : $hostCache;
144145
return;
145146
}
146147

0 commit comments

Comments
 (0)