|
@@ -78,13 +78,14 @@ static double _YYDeviceSystemVersion() {
|
|
}
|
|
}
|
|
|
|
|
|
- (NSDictionary *)yy_attributesAtIndex:(NSUInteger)index {
|
|
- (NSDictionary *)yy_attributesAtIndex:(NSUInteger)index {
|
|
|
|
+ if (index > self.length || self.length == 0) return nil;
|
|
if (self.length > 0 && index == self.length) index--;
|
|
if (self.length > 0 && index == self.length) index--;
|
|
return [self attributesAtIndex:index effectiveRange:NULL];
|
|
return [self attributesAtIndex:index effectiveRange:NULL];
|
|
}
|
|
}
|
|
|
|
|
|
- (id)yy_attribute:(NSString *)attributeName atIndex:(NSUInteger)index {
|
|
- (id)yy_attribute:(NSString *)attributeName atIndex:(NSUInteger)index {
|
|
if (!attributeName) return nil;
|
|
if (!attributeName) return nil;
|
|
- if (self.length == 0) return nil;
|
|
|
|
|
|
+ if (index > self.length || self.length == 0) return nil;
|
|
if (self.length > 0 && index == self.length) index--;
|
|
if (self.length > 0 && index == self.length) index--;
|
|
return [self attribute:attributeName atIndex:index effectiveRange:NULL];
|
|
return [self attribute:attributeName atIndex:index effectiveRange:NULL];
|
|
}
|
|
}
|