Closed Bug 663269 Opened 13 years ago Closed 13 years ago

Handle null livemarks siteURI

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla7

People

(Reporter: mak, Assigned: mak)

References

Details

(Whiteboard: [fixed-in-places])

Attachments

(1 file)

siteURI can be null, but we don't handle that, this patch makes so that if siteURI is null we fallback to feedURI, that can never be null.

Sorry for lots of lm bugs, but I'm splitting my livemark refactoring patch in multiple bugs, the main patch will be big enough by itself.
Attached patch patch v1.0Splinter Review
Attachment #538383 - Flags: review?(dietrich)
Comment on attachment 538383 [details] [diff] [review]
patch v1.0

Review of attachment 538383 [details] [diff] [review]:
-----------------------------------------------------------------

r=me

::: toolkit/components/places/PlacesUtils.jsm
@@ +597,5 @@
>          function gatherDataUrl(bNode) {
>            if (PlacesUtils.nodeIsLivemarkContainer(bNode)) {
> +            let uri = PlacesUtils.livemarks.getSiteURI(bNode.itemId) ||
> +                      PlacesUtils.livemarks.getFeedURI(bNode.itemId);
> +            return uri.spec + NEWLINE + bNode.title;

hm, don't both of these throw? should we handle that in each of these cases in this patch?
Attachment #538383 - Flags: review?(dietrich) → review+
(In reply to comment #2)

> ::: toolkit/components/places/PlacesUtils.jsm
> @@ +597,5 @@
> >          function gatherDataUrl(bNode) {
> >            if (PlacesUtils.nodeIsLivemarkContainer(bNode)) {
> > +            let uri = PlacesUtils.livemarks.getSiteURI(bNode.itemId) ||
> > +                      PlacesUtils.livemarks.getFeedURI(bNode.itemId);
> > +            return uri.spec + NEWLINE + bNode.title;
> 
> hm, don't both of these throw? should we handle that in each of these cases
> in this patch?

Well if it's a livemark it must have a feedURI, and may have an optional siteURI. So the former won't throw, the latter may, but it's unexpected so it's fine to throw.
http://hg.mozilla.org/projects/places/rev/2075b349013e
Whiteboard: [fixed-in-places]
http://hg.mozilla.org/mozilla-central/rev/2075b349013e
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Blocks: 435124
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: