Fix NPE on HaloUtils.getDefaultQiniuZone method(issue: #110)

pull/137/head
johnniang 2019-03-05 17:45:58 +08:00
parent 168a320edc
commit a1e15fea12
1 changed files with 7 additions and 1 deletions

View File

@ -62,9 +62,15 @@ public class HaloUtils {
*/
@NonNull
public static Zone getDefaultQiniuZone() {
Zone zone;
// Get zone from setting
String qiniuZone = OPTIONS.get("qiniu_zone");
if (StrUtil.isBlank(qiniuZone)) {
return Zone.autoZone();
}
Zone zone;
switch (qiniuZone) {
case "z0":
zone = Zone.zone0();