Closed
Bug 1216183
Opened 10 years ago
Closed 10 years ago
[Messages] We should not fail when the attachment is incorrect
Categories
(Firefox OS Graveyard :: Gaia::SMS, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
2.6 S2 - 12/4
People
(Reporter: julienw, Assigned: rishav_, Mentored)
References
Details
(Whiteboard: [good first bug][sms-papercuts][lang=js])
Attachments
(1 file)
I noticed that when we're in this situation like bug 1215471 we can't display the attachment menu. Here is the error log:
10-19 17:46:10.357 29418 29418 E Messages: [JavaScript Error: "TypeError: name.lastIndexOf is not a function" {file: "app://sms.gaiamobile.org/views/conversation/js/compose.js" line: 46}]
I think we should not crash like this and instead default to an empty name.
At the very least, replace line 682:
var name = currentAttachment.name;
by
var name = currentAttachment.name || '';
Reporter | ||
Comment 1•10 years ago
|
||
actually, "name" is not empty here. So the issue is that it's not a string.
I think we should change something in [1], make sure we get a string, and replace with '' if it's not a string.
[1] https://github.com/mozilla-b2g/gaia/blob/d344af789c6abadb754262af47827c2057b082db/apps/sms/views/conversation/js/attachment.js#L29
![]() |
||
Comment 2•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → rishav006
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8678218 [details] [review]
[gaia] kumarrishav:Bug-1216183 > mozilla-b2g:master
Here is the patch :) hope it's good.
Attachment #8678218 -
Flags: review?(felash)
Reporter | ||
Comment 4•10 years ago
|
||
Comment on attachment 8678218 [details] [review]
[gaia] kumarrishav:Bug-1216183 > mozilla-b2g:master
I left comments on github :)
thanks !
Attachment #8678218 -
Flags: review?(felash)
Assignee | ||
Comment 5•10 years ago
|
||
Comment on attachment 8678218 [details] [review]
[gaia] kumarrishav:Bug-1216183 > mozilla-b2g:master
Hi Julien,
Hope it's fine now. Not sure if comments are fine or not.
Thanks
Attachment #8678218 -
Flags: review?(felash)
Reporter | ||
Comment 6•10 years ago
|
||
Comment on attachment 8678218 [details] [review]
[gaia] kumarrishav:Bug-1216183 > mozilla-b2g:master
r=me but please fix the 2 nits before landing !
Thanks !
Attachment #8678218 -
Flags: review?(felash) → review+
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
![]() |
||
Comment 7•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.6 S2 - 12/4
You need to log in
before you can comment on or make changes to this bug.
Description
•