Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for empty lists #155

Open
yschimke opened this issue Dec 5, 2021 · 1 comment
Open

Support for empty lists #155

yschimke opened this issue Dec 5, 2021 · 1 comment

Comments

@yschimke
Copy link

yschimke commented Dec 5, 2021

@Xml(name = "list")
data class TaskList(
    @Attribute
    var id: String,

    @Element
    var taskseries: List<TaskSeries>
)

Fails on

    <list id="45104215"/>

With

java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter taskseries

Is the only solution to make the list nullable? I consider this an empty list rather than a null list.

@yschimke
Copy link
Author

yschimke commented Dec 5, 2021

Nice library, I hope you get come low effort releasing going for your sake. I'm using snapshots at the moment which is workable, but not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant