Skip to content

Commit 4fdaadb

Browse files
committed
fix(ios): prevent error when image loaded after view dispose
1 parent 9bd6af7 commit 4fdaadb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/image/index.ios.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ export class Img extends ImageBase {
290290

291291
private handleImageLoaded = (image: UIImage, error: NSError, cacheType: number) => {
292292
this.isLoading = false;
293+
if (!this.nativeViewProtected) {
294+
return;
295+
}
293296
const animate = (this.alwaysFade || cacheType !== SDImageCacheType.Memory) && this.fadeDuration > 0;
294297
if (image) {
295298
this._setNativeImage(image, animate);

0 commit comments

Comments
 (0)