Bug 21015 - KURL's getters are inconsitent about returning null or empty strings
: KURL's getters are inconsitent about returning null or empty strings
Status: NEW
Product: WebKit
Classification: Unclassified
Component: Platform
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Nobody
:
Depends on:
Blocks: 37641
  Show dependency treegraph
 
Reported: 2008-09-22 19:58 PDT by Brett Wilson (Google)
Modified: 2010-04-15 00:42 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Wilson (Google) 2008-09-22 19:58:15 PDT
KURL's getters randomly return either isNull or empty strings. This is potentially dangerous if some code relies on this.

Returns a null string on empty:
  pass()
  lastPathComponent()
  ref()

Returns an empty string on empty (although at least some of these will return a null string if the URL is itself null):
  protocol()
  user()
  host()
  query()
  path()

We can make them all return null strings, all return empty strings, or return null strings only when the URL is itself NULL, and empty the rest of the time (I think this is currently the dominant behavior).
Comment 1 Alexey Proskuryakov 2008-09-23 00:05:04 PDT
With any changes, we'll need to check all callers - in many cases, the behavior is not exactly random, even if it is painfully inconsistent.