SafariExtensions icon indicating copy to clipboard operation
SafariExtensions copied to clipboard

FB11664965 - SFSafariExtensionHandling validateToolbarItemInWindow:validationHandler: incorrect nullability annotation

Open lapcat opened this issue 2 years ago • 0 comments

In the SFSafariExtensionHandling.h header, the method - (void)validateToolbarItemInWindow:(SFSafariWindow *)window validationHandler:(void (^)(BOOL enabled, NSString *badgeText))validationHandler; annotates the badgeText parameter as nonnull, because of NS_ASSUME_NONNULL_BEGIN. However, I believe that it should be annotated as nullable. https://developer.apple.com/documentation/safariservices/sfsafariextensionhandling/1639492-validatetoolbariteminwindow?language=objc At runtime, the validate handler successfully takes nil as an argument, and the method SFSafariToolbarItem setBadgeText: has the documentation "Pass nil to remove the badge." https://developer.apple.com/documentation/safariservices/sfsafaritoolbaritem/2823945-setbadgetext?language=objc

lapcat avatar Dec 26 '22 20:12 lapcat