Summary: | WKNavigationResponse._downloadAttribute should be nil when no download attribute is present | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||
Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | beidson, commit-queue, darin, david_quesada, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Alex Christensen
2019-04-10 22:35:31 PDT
Created attachment 367205 [details]
Patch
*** Bug 196806 has been marked as a duplicate of this bug. *** Comment on attachment 367205 [details] Patch Clearing flags on attachment: 367205 Committed r244184: <https://trac.webkit.org/changeset/244184> All reviewed patches have been landed. Closing bug. Comment on attachment 367205 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367205&action=review > Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponse.mm:84 > - return _navigationResponse->downloadAttribute(); > + const String& attribute = _navigationResponse->downloadAttribute(); > + return attribute.isNull() ? nil : (NSString *)attribute; The function nsStringNilIfEmpty from WTFString.h was designed for uses like this one. I admit it does not have a beautiful name, but this is exactly what it’s for. Comment on attachment 367205 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367205&action=review >> Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponse.mm:84 >> + return attribute.isNull() ? nil : (NSString *)attribute; > > The function nsStringNilIfEmpty from WTFString.h was designed for uses like this one. I admit it does not have a beautiful name, but this is exactly what it’s for. Oops, no, this is "nil if null", which is not the same thing. Sorry. |