From f2e6c86c79aaebc48731128d6e0ea58506eaad0b Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 19 Sep 2020 16:47:24 +0200 Subject: [PATCH] Fixed an issue with adding empty orphaned files to the project --- .gitignore | 1 + nw/core/project.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a515c603..fdfe7e87 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ __pycache__ # PyTest /prof/ +/htmlcov/ /tests/temp /tests/lipsum/cache /tests/lipsum/meta diff --git a/nw/core/project.py b/nw/core/project.py index 5c187d7c..414c4f18 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -1311,8 +1311,10 @@ class NWProject(): # Look for meta data oName = "" - if aDoc.openDocument(oHandle, showStatus=False, isOrphan=True): - oName, oPath, oClass, oLayout = aDoc.getMeta() + oClass = None + oLayout = None + if aDoc.openDocument(oHandle, showStatus=False, isOrphan=True) is not None: + oName, _, oClass, oLayout = aDoc.getMeta() if oName == "": nOrph += 1