Closed
Bug 881717
Opened 8 years ago
Closed 8 years ago
Deal with err case in MakeAPI callback
Categories
(Webmaker Graveyard :: webmaker.org, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: humph, Assigned: mjschranz)
Details
Attachments
(1 file)
We have code in webmaker.org that is using the MakeAPI, but assuming that no error is returned. This results in us trying to access a .length property of a null object (data), which in turn crashes the server. The problem is in https://github.com/mozilla/webmaker.org/blob/master/lib/makeapi-webmaker.js#L7 We should be doing 2 things there. 1) check on what the value of err is, and if non-null, deal with it here (i.e., early callback vs. processing data). 2) check that data is non-null before we try to access any properties on it. It *should* be an array; but if it isn't, let's not crash.
| Assignee | ||
Comment 1•8 years ago
|
||
Attachment #760920 -
Flags: review?(david.humphrey)
| Reporter | ||
Comment 2•8 years ago
|
||
Comment on attachment 760920 [details] [review] https://github.com/mozilla/webmaker.org/pull/106 One switch to the data-null case, looks good with that. Thanks for patching so quickly. Let's get this landed.
Attachment #760920 -
Flags: review?(david.humphrey) → review+
Comment 3•8 years ago
|
||
Commit pushed to master at https://github.com/mozilla/webmaker.org https://github.com/mozilla/webmaker.org/commit/e09818502e430a092af6d45488f017bbb1298b4b Fix Bug 881717 - Handle error conditions from MakeAPI
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Attachment mime type: text/plain → text/x-github-pull-request
You need to log in
before you can comment on or make changes to this bug.
Description
•