iOS: protect setFrame incase crash
This commit is contained in:
parent
6e3307d400
commit
7f6710a7b5
@ -262,6 +262,13 @@ - (void)setFrame {
|
||||
}
|
||||
BOOL isFrameChange = ![self rect:originFrame equalTo:self.view.frame];
|
||||
if (isFrameChange) {
|
||||
if (isnan(originFrame.origin.x) || isinf(originFrame.origin.x)
|
||||
|| isnan(originFrame.origin.y) || isinf(originFrame.origin.y)
|
||||
|| isnan(originFrame.size.width) || isinf(originFrame.size.width)
|
||||
|| isnan(originFrame.size.height) || isinf(originFrame.size.height)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
self.view.frame = originFrame;
|
||||
}
|
||||
if (!UIEdgeInsetsEqualToEdgeInsets(self.corners, UIEdgeInsetsZero)) {
|
||||
|
Reference in New Issue
Block a user