Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120504

REG: Call on null object in optional chain throws an error

XMLWordPrintable

    • 796dd2ab8 (dev), 072048f98 (6.7)

       

          property QtObject target: null
          Component.onCompleted: {
              target?.destroy()
          }
      

      qrc:/qt/qml/Truc/Main.qml:11: TypeError: Cannot read property 'destroy' of null

       

      It should not attempt to call destroy and simply return undefined.
      This was introduced by https://codereview.qt-project.org/c/qt/qtdeclarative/+/515973

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            olivier.decanniere Olivier De Cannière
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes