← Back to team overview

ubuntu-phone team mailing list archive

[QML] TypeError on delegate remove

 

I have a custom component used as a delegate in a ListView. When this
object is removed I get the error:

    TypeError: Cannot read property of null

This is occurring on the rather standard line:

    anchors { left: parent.left; right: parent.right }

So, how am I supposed to clean up this error? The only thing I can
think of, is a hacky looking bit of code like:

    anchors { left: (index == -1) ? 0 : parent.left; right: (index == 
    -1) ? 0 : parent.right }

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups