From c67e6d6abc08eaf54ae0b625f269a06ae5ca775e Mon Sep 17 00:00:00 2001 From: Matt Jenkins Date: Mon, 3 Feb 2020 16:13:17 +0000 Subject: [PATCH] Remove orphan chapter if empty --- src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java index 828c9e2..ed8bc64 100644 --- a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java +++ b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java @@ -4193,6 +4193,9 @@ public class AudiobookRecorder extends JFrame implements DocumentListener { } } } + if (orphans.getChildCount() == 0) { + bookTreeModel.removeNodeFromParent(orphans); + } } public Chapter getChapterById(String id) {