Skip to content

Commit

Permalink
fix: ensure nativeview exists #43
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed May 28, 2021
1 parent fd0f4e9 commit 38dce3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/image.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ export class Img extends ImageBase {
}
updateViewSize(imageInfo) {
const draweeView = this.nativeViewProtected;
if (!draweeView) {
return;
}
if (imageInfo != null) {
draweeView.imageWidth = imageInfo.getWidth();
draweeView.imageHeight = imageInfo.getHeight();
Expand Down Expand Up @@ -566,7 +569,7 @@ export class Img extends ImageBase {

const args = {
eventName: ImageBase.finalImageSetEvent,
object: that.get(),
object: nativeView,
imageInfo: info,
animatable: animatable as AnimatedImage,
} as FinalEventData;
Expand Down

0 comments on commit 38dce3f

Please sign in to comment.