Coverity: avoid crashing the catch code
badgeData was set to undefined and crashed, causing the badgeData.text[1] reset to crash as well.
This commit is contained in:
@@ -876,8 +876,8 @@ cache(function(data, match, sendBadge, request) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
badgeData = JSON.parse(buffer);
|
||||
sendBadge(format, badgeData);
|
||||
var data = JSON.parse(buffer);
|
||||
sendBadge(format, data);
|
||||
} catch(e) {
|
||||
badgeData.text[1] = 'invalid';
|
||||
sendBadge(format, badgeData);
|
||||
|
||||
Reference in New Issue
Block a user