Closed justincpollard closed 7 years ago
Hey @justincpollard! I was able to reproduce this and a fix would be pretty straight foward. Are you guys working off of this branch: https://github.com/johncarl81/transfuse/pull/196?
Hey John! We're actually using 0.3.0-beta-9
. Thanks for the quick response :-)
^ That should do the trick. Could you try it out?
Hey John, I'll try to take a look next week; off on a brief weekend vacation. Thanks for looking into this :-)
Cool, thanks for reporting the issue. Let me know when you get back around to it.
Hey John, sorry I never got to this :-( I've been head down for the past 2 months on a feature we're releasing this week.
Quite alright. I've done quite a bit of testing around this feature and it was about time to clean up the open PRs. Of course, let me know if you have any issues.
I'm trying to pass an
@Parcel
annotated@Extra
into my activity like so:The
DetailModel
class is annotated with@Parcel
from your Parceler library.Since this param is optional, sometimes it will be null. Unfortunately, when it is null, the app crashes with this exception:
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Object org.parceler.ParcelWrapper.getParcel()' on a null object reference
It looks like the generated code doesn't take into account that a
@Parcel
could be null; it callsParcelWrapper.getParcel()
anyway:((DetailModel)((ParcelWrapper) ExtraUtil.getExtra(this.getIntent().getExtras(), "theParcel", true)).getParcel())