tikxml icon indicating copy to clipboard operation
tikxml copied to clipboard

Support for empty lists

Open yschimke opened this issue 3 years ago • 1 comments

@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 avatar Dec 05 '21 08:12 yschimke

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.

yschimke avatar Dec 05 '21 08:12 yschimke