question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException when Epoxy model is bind to data class

See original GitHub issue

I have noticed that epoxy throws this exception when the model use the data class with kotlin 1.5.10 and 1.5.0

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.hashCode()' on a null object reference
        at org.zxconnect.android.daylivro.models.entity.Product.hashCode(Unknown Source:19)
        at org.zxconnect.android.delivro.ProductBindingModel_.hashCode(ProductBindingModel_.java:330)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
eric-ampirecommented, May 31, 2021

Yes, it is the exception that is triggered, but if I remove when I remove the keyword data, there is no more exception

In my model there is no property with null as default value, The application does not trigger the exception if I use Kotlin version 1.4.30

1reaction
tekinumutcommented, Feb 4, 2022

@zhambylgaziz i guess you must initialize your data class variable as nullable like me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to use with DataBindings and AndroidX when not ...
Hi I tried it with a simple DataBinding as a Model but building gives me: e: error: Epoxy Processor Exception: Caused by TypeCastException: ......
Read more >
Using the Epoxy ModelView causes Inflate errors and ...
I'm using the @ModelView annotation from the Epoxy library to create a CustomView . I'm making it with reference to another example, but...
Read more >
Fixing NullPointerException when trying to bind RatingBar ...
In the generated code something like this happens. ratingBarView.setRating(rating); //rating == null :( Fixing it. Fortunately with Data Binding ...
Read more >
How do I properly initialize a property in Epoxy ModelView ...
i.e "you can't have data provided both by saved state and by a model prop since they ... @ModelView(saveViewState = true) class RowView:...
Read more >
error: cannot generate view binders java.lang ... - Issue Tracker
If you run with --debug, data binding will print debug logs. ... Task] i: Note: checking method api for setOnClickListener, class:java/lang/Object ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found