From 8ac24de12f9ff6727fa0cc77e4ae180d7dc32a0b Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 1 Apr 2014 22:43:32 +0200 Subject: convwatch.py: fix handling of loadComponentFromURL returning null Change-Id: Icc64d56a74be9e95fdf69204356f9c2405ce7cc8 --- bin/convwatch.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin/convwatch.py') diff --git a/bin/convwatch.py b/bin/convwatch.py index bef3f9e16c77..283e67e52581 100644 --- a/bin/convwatch.py +++ b/bin/convwatch.py @@ -240,8 +240,11 @@ def loadFromURL(xContext, url): xGEB = xContext.getValueByName( "/singletons/com.sun.star.frame.theGlobalEventBroadcaster") xGEB.addDocumentEventListener(xListener) + xDoc = None try: xDoc = xDesktop.loadComponentFromURL(url, "_blank", 0, loadProps) + if xDoc is None: + raise Exception("No document loaded?") time_ = 0 while time_ < 30: if xListener.layoutFinished: @@ -280,6 +283,7 @@ class LoadPrintFileTest: self.prtsuffix = prtsuffix def run(self, xContext): print("Loading document: " + self.file) + xDoc = None try: url = "file://" + quote(self.file) xDoc = loadFromURL(xContext, url) -- cgit