Skip to content

Commit c2be4f0

Browse files
author
yangsen
committed
auto zone isValid: all zones max be valid
1 parent 1039ba2 commit c2be4f0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

QiniuSDK/Common/QNZoneInfo.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,17 @@ - (void)toTemporary {
191191
}
192192

193193
- (BOOL)isValid {
194-
return [self.zonesInfo count] > 0 && [self.zonesInfo.firstObject isValid];
194+
if ([self.zonesInfo count] == 0) {
195+
return false;
196+
}
197+
198+
BOOL valid = true;
199+
for (QNZoneInfo *info in self.zonesInfo) {
200+
if (![info isValid]) {
201+
valid = false;
202+
}
203+
}
204+
return valid;
195205
}
196206

197207
- (id)copyWithZone:(NSZone *)zone {

0 commit comments

Comments
 (0)