瀏覽代碼

Check if filename is None

Kentaro Wada 7 年之前
父節點
當前提交
af1345eb95
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      labelme/app.py

+ 2 - 1
labelme/app.py

@@ -393,7 +393,8 @@ class MainWindow(QMainWindow, WindowMixin):
         # Populate the File menu dynamically.
         self.updateFileMenu()
         # Since loading the file may take some time, make sure it runs in the background.
-        self.queueEvent(partial(self.loadFile, self.filename))
+        if self.filename is not None:
+            self.queueEvent(partial(self.loadFile, self.filename))
 
         # Callbacks:
         self.zoomWidget.valueChanged.connect(self.paintCanvas)