From e8238c03f2d554f050658f7255c3888901dc7205 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 5 Nov 2020 10:34:26 -0600 Subject: [PATCH 1/4] Don't enable the Add button unless all conditions for an Add have been met. Fixes #2555 --- Mac/MainWindow/AddFeed/AddWebFeedWindowController.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Mac/MainWindow/AddFeed/AddWebFeedWindowController.swift b/Mac/MainWindow/AddFeed/AddWebFeedWindowController.swift index b05eacbcd..16c8a4d72 100644 --- a/Mac/MainWindow/AddFeed/AddWebFeedWindowController.swift +++ b/Mac/MainWindow/AddFeed/AddWebFeedWindowController.swift @@ -96,7 +96,7 @@ class AddWebFeedWindowController : NSWindowController, AddFeedWindowController { return } - let container = selectedContainer()! + guard let container = selectedContainer() else { return } AddWebFeedDefaultContainer.saveDefaultContainer(container) delegate?.addFeedWindowController(self, userEnteredURL: url, userEnteredTitle: userEnteredTitle, container: container) @@ -122,7 +122,7 @@ class AddWebFeedWindowController : NSWindowController, AddFeedWindowController { private extension AddWebFeedWindowController { private func updateUI() { - addButton.isEnabled = urlTextField.stringValue.mayBeURL + addButton.isEnabled = urlTextField.stringValue.mayBeURL && selectedContainer() != nil } func cancelSheet() { @@ -130,6 +130,7 @@ private extension AddWebFeedWindowController { } func selectedContainer() -> Container? { + guard folderPopupButton.selectedItem?.isEnabled ?? false else { return nil } return folderPopupButton.selectedItem?.representedObject as? Container } } From 69911bd91469c67e0eccfff91a70a018b80c4ac6 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 6 Nov 2020 16:52:50 -0800 Subject: [PATCH 2/4] Bump version. --- xcconfig/common/NetNewsWire_mac_target_common.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig index 2e9918ef0..08f5f7d68 100644 --- a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig +++ b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig @@ -1,6 +1,6 @@ // High Level Settings common to both the Mac application and any extensions we bundle with it -MARKETING_VERSION = 5.1.2 -CURRENT_PROJECT_VERSION = 3016 +MARKETING_VERSION = 5.1.3b1 +CURRENT_PROJECT_VERSION = 3017 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon From e297a53eb2f35aff00e4cde1010580e10be47abb Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Fri, 6 Nov 2020 17:03:20 -0800 Subject: [PATCH 3/4] Fix out-of-index crash by guarding against a 0-length string. --- Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift b/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift index de75fc46e..82f49370a 100644 --- a/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift +++ b/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift @@ -53,7 +53,10 @@ final class MultilineTextFieldSizer { } static func size(for attributedString: NSAttributedString, numberOfLines: Int, width: Int) -> TextFieldSizeInfo { - + guard attributedString.length > 0 else { + return TextFieldSizeInfo(size: NSSize.zero, numberOfLinesUsed: 0) + } + // Assumes the same font family/size for the whole string let font = attributedString.attribute(.font, at: 0, effectiveRange: nil) as! NSFont From 18febf136c38049efe53e15c3d0fea2a87af15e2 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 8 Nov 2020 16:46:58 -0800 Subject: [PATCH 4/4] Bump version. --- xcconfig/common/NetNewsWire_mac_target_common.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig index 08f5f7d68..a6e1b4709 100644 --- a/xcconfig/common/NetNewsWire_mac_target_common.xcconfig +++ b/xcconfig/common/NetNewsWire_mac_target_common.xcconfig @@ -1,6 +1,6 @@ // High Level Settings common to both the Mac application and any extensions we bundle with it -MARKETING_VERSION = 5.1.3b1 -CURRENT_PROJECT_VERSION = 3017 +MARKETING_VERSION = 5.1.3 +CURRENT_PROJECT_VERSION = 3018 ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon