Skip to content

Commit 3dda466

Browse files
committed
avoid crash.
1 parent 6c352b2 commit 3dda466

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/src/main/java/com/opensource/svgaplayer/SVGAImageView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ open class SVGAImageView : ImageView {
8282
constructor(context: Context) : super(context) {}
8383

8484
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
85-
loadAttrs(attrs)
85+
attrs?.let { loadAttrs(it) }
8686
}
8787

8888
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
89-
loadAttrs(attrs)
89+
attrs?.let { loadAttrs(it) }
9090
}
9191

9292
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
93-
loadAttrs(attrs)
93+
attrs?.let { loadAttrs(it) }
9494
}
9595

9696
fun loadAttrs(attrs: AttributeSet) {

0 commit comments

Comments
 (0)