You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I'm trying to change the text in my view via DSL.text(CharSequence). Sometimes text can be null, which seems to be incorrectly handled by library:
java.lang.IllegalArgumentException: method android.widget.TextView.setText argument 1 has type int, got null
at java.lang.reflect.Method.invoke(Native Method)
at trikita.anvil.PropertySetter.set(PropertySetter.java:106)
at trikita.anvil.Anvil$Mount$Iterator.attr(Anvil.java:331)
at trikita.anvil.BaseDSL.attr(BaseDSL.java:105)
at trikita.anvil.DSL.text(DSL.java:2141)
Clearly it happens because value is null and chosen method has signature for int, which is not checked.
I assume value type should be passed to PropertySetter.set explicitly to handle this issue gracefully.
Existing workaround is to set text to empty string instead of null.
The text was updated successfully, but these errors were encountered:
Hi. I'm trying to change the text in my view via
DSL.text(CharSequence)
. Sometimes text can be null, which seems to be incorrectly handled by library:Crash happens around:
Clearly it happens because value is
null
and chosen method has signature forint
, which is not checked.I assume value type should be passed to
PropertySetter.set
explicitly to handle this issue gracefully.Existing workaround is to set text to empty string instead of
null
.The text was updated successfully, but these errors were encountered: