toURLRef() in WKSharedAPICast.h should return null for a null string. Looks like it's just missing a "return" here: if (!string) ProxyingRefPtr<WebURL>(0);
Created attachment 109705 [details] Patch: Add the missing return for the null string case.
Committed: http://trac.webkit.org/changeset/96656
What's the user-visible or developer-visible effect of this bug? In general I think it's a lot more useful to have bugs describe symptoms rather than describing changes we'd like to make to the code. Is it possible to write a regression test for this?
(In reply to comment #3) > What's the user-visible or developer-visible effect of this bug? In general I think it's a lot more useful to have bugs describe symptoms rather than describing changes we'd like to make to the code. If WKURLCopyCFURL() is called on the resulting WKURLRef later, it'll assert in ASSERT(!toImpl(URLRef)->string().isNull()); because the string is null. > Is it possible to write a regression test for this? I'll look into writing a TestWebKitAPI test for this. Thanks for the suggestion!
(In reply to comment #3) > What's the user-visible or developer-visible effect of this bug? In general I think it's a lot more useful to have bugs describe symptoms rather than describing changes we'd like to make to the code. > > Is it possible to write a regression test for this? Coming up with a test for this is not as straightforward as I imagined, since we can't call toURLRef() directly from a TestWebKitAPI test. I've filed https://bugs.webkit.org/show_bug.cgi?id=70159 to track coming up with a test for this.