diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2015-12-15 14:38:12 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2015-12-16 06:56:04 +0000 |
commit | add9875ec266351e7c2878a1e93da34181abab29 (patch) | |
tree | c08cb23d11e1834125e05866ecf740bd888452a6 /src | |
parent | 80cde7c7ca22511494ae6d32b2023fb1e92ede4d (diff) | |
download | qtquickcontrols-add9875ec266351e7c2878a1e93da34181abab29.tar.gz |
Check if any menu item is selected when mouse is released
Sometimes I get below error while accessing history menu item in quicknanobrowser :
qtbase/qml/QtQuick/Controls/Private/ColumnMenuContent.qml:204: TypeError: Cannot read property '__menuItem' of null
Added a check to fix this error
Task-number: QTBUG-49968
Change-Id: I934da87fd5f95e40b20dfead81bae68b1415836f
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/Private/ColumnMenuContent.qml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/controls/Private/ColumnMenuContent.qml b/src/controls/Private/ColumnMenuContent.qml index 4d0f944d..d184524e 100644 --- a/src/controls/Private/ColumnMenuContent.qml +++ b/src/controls/Private/ColumnMenuContent.qml @@ -201,7 +201,7 @@ Item { onPositionChanged: updateCurrentItem({ "x": mouse.x, "y": mouse.y }) onPressed: updateCurrentItem({ "x": mouse.x, "y": mouse.y }) onReleased: { - if (currentItem.__menuItem.enabled) { + if (currentItem && currentItem.__menuItem.enabled) { if (currentItem.styleData.type === MenuItemType.Menu) { showCurrentItemSubMenu(true) } else { |