[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - loleaflet/src

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 13 11:26:31 UTC 2019


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

New commits:
commit b8a8c12694c7db415d3bee6f2dc53ec2eb0eedfb
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Jun 11 17:02:57 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
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 <tml at collabora.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

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'));


More information about the Libreoffice-commits mailing list