From 2ae66468853873d0927c2caf11bcb64ad57bebf7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 19 Sep 2020 16:38:31 +0200 Subject: [PATCH] Added a check in merge documents that there is actually something to merge --- nw/gui/docmerge.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nw/gui/docmerge.py b/nw/gui/docmerge.py index 06eb226a..d8650ecb 100644 --- a/nw/gui/docmerge.py +++ b/nw/gui/docmerge.py @@ -101,6 +101,12 @@ class GuiDocMerge(QDialog): for i in range(self.listBox.count()): finalOrder.append(self.listBox.item(i).data(Qt.UserRole)) + if len(finalOrder) == 0: + self.theParent.makeAlert(( + "No source documents found. Nothing to do." + ), nwAlert.ERROR) + return + theDoc = NWDoc(self.theProject, self.theParent) theText = "" for tHandle in finalOrder: