raamcosta / compose-destinations

Annotation processing library for type-safe Jetpack Compose navigation with no boilerplate.
https://composedestinations.rafaelcosta.xyz
Apache License 2.0
3.14k stars 129 forks source link

[ksp] java.lang.NullPointerException when using custom NavArgument type #624

Closed KarolCieslar closed 1 month ago

KarolCieslar commented 2 months ago

When i try to add custom NavGraph Argument to my custom Graph (SettingGraph) i have error [ksp] java.lang.NullPointerException. Everythings is ok when i use String, Int, Double etc as a argument type.

NavGraph: image

Model: image

Stacktrace: https://hastebin.skyra.pw/kikuleweru.php

Compose Destinations version: 2.1.0-beta02 KSP Version: 1.9.23-1.0.20

raamcosta commented 1 month ago

Hi 👋

Can you provide again the stack trace? Seems I cannot reproduce this 🤔

KarolCieslar commented 1 month ago

@raamcosta There is a StackTrace: https://pastebin.com/jm9FHf1x

raamcosta commented 1 month ago

This doesn’t seem like the same one. This looks not even related to this library. You mentioned a NullPointerException?

KarolCieslar commented 1 month ago

@raamcosta Oh.. i provided wrong stacktrace. Sorry for that. Here is correct one: https://pastebin.com/Y9TYRY7K

KarolCieslar commented 1 month ago

@raamcosta can You look at this?

raamcosta commented 1 month ago

Sorry I have been busy these last days. I will be checking it this week.

raamcosta commented 1 month ago

You are absolutely right, thank you for reporting 🙏

Will be fixing this in the coming days!

raamcosta commented 1 month ago

Fix is up!

KarolCieslar commented 1 month ago

@raamcosta there is a another error after update. https://pastebin.com/tSNithPr

raamcosta commented 1 month ago

Interesting.. I will check this today

raamcosta commented 1 month ago

Is CardWithMask an: Enum or Parcelable or java Serializable or Ktx Serializable or has a custom type serializer?

KarolCieslar commented 1 month ago

Oooppss i forgot about @Parcelize ;/ My bad. Now everythings is working but i still do not understand how to retrive NavGraphs arguments from "nonstart" Destination. Here more info https://github.com/raamcosta/compose-destinations/issues/633

raamcosta commented 1 month ago

Not just your bad. I also missed throwing a more helpful message in this case for graph nav args. will do so for next release. Will also get back to you on that one later.