Closed Bug 596282 Opened 9 years ago Closed 9 years ago

Error in the js console if fullcount does not exists

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vingtetun, Assigned: vingtetun)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
I've encountered this case with my gmail account (that I never really used)

result page I've on my gmail account:
https://mail.google.com/mail/feed/atomLine:%201
Attachment #475125 - Flags: review?(mark.finkle)
Comment on attachment 475125 [details] [diff] [review]
Patch

>-              this._lastCount = req.responseXML.getElementsByTagName("fullcount")[0].childNodes[0].nodeValue;
>+              let count = req.responseXML.getElementsByTagName("fullcount");
>+              if (count)
>+                this._lastCount = count[0].childNodes[0].nodeValue;

What about setting to 0 if no fullcount?

this._lastCount = count ? count[0].childNodes[0].nodeValue : 0;

how's that?
(In reply to comment #1)
> Comment on attachment 475125 [details] [diff] [review]
> Patch
> 
> >-              this._lastCount = req.responseXML.getElementsByTagName("fullcount")[0].childNodes[0].nodeValue;
> >+              let count = req.responseXML.getElementsByTagName("fullcount");
> >+              if (count)
> >+                this._lastCount = count[0].childNodes[0].nodeValue;
> 
> What about setting to 0 if no fullcount?
> 
> this._lastCount = count ? count[0].childNodes[0].nodeValue : 0;
> 
> how's that?

wfm
you patch or me patch?
Attached patch Patch v0.2Splinter Review
Attachment #475125 - Attachment is obsolete: true
Attachment #475833 - Flags: review?(mark.finkle)
Attachment #475125 - Flags: review?(mark.finkle)
Comment on attachment 475833 [details] [diff] [review]
Patch v0.2

Clear to land for b1
Attachment #475833 - Flags: review?(mark.finkle) → review+
http://hg.mozilla.org/mobile-browser/rev/a292fad385ac
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
bugspam
Assignee: nobody → 21
You need to log in before you can comment on or make changes to this bug.