loleaflet/src/layer/AnnotationManager.js |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit b8a8c12694c7db415d3bee6f2dc53ec2eb0eedfb
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Tue Jun 11 17:02:57 2019 +0300
Commit:     Andras Timar <[email protected]>
CommitDate: Thu Jun 13 13:26:13 2019 +0200

    Avoid unhandled exception
    
    Change-Id: I2a168a79f334ca5048a85f98350aaa5c08bd1ad8
    Reviewed-on: https://gerrit.libreoffice.org/73948
    Reviewed-by: Tor Lillqvist <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Andras Timar <[email protected]>

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index c8a623639..8ff4b6a04 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -807,6 +807,14 @@ L.AnnotationManager = L.Class.extend({
                        };
                }
 
+               // What if this._initialLayoutData is still undefined when we 
get here? (I.e. if
+               // contentWrapperClass.length == 0.) No idea. Using
+               // this._initialLayoutData.menuWidth below will lead to an 
unhandled exception.
+               // Maybe best to just return then? Somebody who understands the 
code could fix this
+               // better, perhaps.
+               if (this._initialLayoutData === undefined)
+                       return;
+
                var menuClass = $('.loleaflet-annotation-menu');
                if ((this._initialLayoutData.menuWidth === undefined) && 
menuClass.length > 0) {
                        this._initialLayoutData.menuWidth = 
parseInt(menuClass.css('width'));
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to