From f5d6e7e8fa06e01ac80c42b7f75530723a2e237e Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 27 Jan 2019 21:42:58 -0800 Subject: [PATCH] Fix bug where empty folders would be lost between runs of the app. --- Frameworks/Account/Account.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index 2ed7a8ed8..989de1b3c 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -762,20 +762,18 @@ private extension Account { return } - guard item.isFolder, let itemChildren = item.children else { - return - } - - // TODO: possibly support sub folders. - guard let folderName = item.titleFromAttributes else { // Folder doesn’t have a name, so it won’t be created, and its items will go one level up. - importOPMLItems(itemChildren, parentFolder: parentFolder) + if let itemChildren = item.children { + importOPMLItems(itemChildren, parentFolder: parentFolder) + } return } if let folder = ensureFolder(with: folderName) { - importOPMLItems(itemChildren, parentFolder: folder) + if let itemChildren = item.children { + importOPMLItems(itemChildren, parentFolder: folder) + } } }