loleaflet/src/control/Control.MobileWizard.js |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit dcdb0afdf58c97c3d20fbf6a4e9d31f65544f6d0
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Aug 13 12:07:06 2020 -0400
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Mon Aug 17 17:56:37 2020 +0200

    loleaflet: fix uncaught exception
    
    Control.MobileWizard.js:363 Uncaught TypeError: Cannot read property 
'children' of undefined
        at NewClass._onMobileWizard (Control.MobileWizard.js:363)
    
    Change-Id: I13617414aca15d8c6120261264911322128a181a
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100680
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index 8f399f69c..58f405f50 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -356,10 +356,12 @@ L.Control.MobileWizard = L.Control.extend({
 
                        this._reset();
 
-                       var mWizardContentLength;
-                       if (data.children[0].type == 'menuitem' || 
data.children[0].children === undefined)
-                               mWizardContentLength = data.children.length;
-                       else mWizardContentLength = 
data.children[0].children.length;
+                       var mWizardContentLength = 0;
+                       if (data.children.length > 0) {
+                               if (data.children[0].type == 'menuitem' || 
data.children[0].children === undefined)
+                                       mWizardContentLength = 
data.children.length;
+                               else mWizardContentLength = 
data.children[0].children.length;
+                       }
 
                        this._showWizard(mWizardContentLength);
                        if (!this._map._docLayer.isCalc()) {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to