Skip to content

Commit

Permalink
use hasOwnProperty to check data.result exists
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarWKH committed Aug 23, 2020
1 parent b019752 commit cf44f9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion celery_progress/static/celery_progress/celery_progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var CeleryProgressBar = (function () {
} else {
onDataError(progressBarElement, progressBarMessageElement, "Data Error");
}
if (data.result) {
if (data.hasOwnProperty('result')) {
onResult(resultElement, data.result);
}
}
Expand Down
2 changes: 1 addition & 1 deletion celery_progress/static/celery_progress/websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var CeleryWebSocketProgressBar = (function () {
} else {
onTaskError(progressBarElement, progressBarMessageElement, data.result);
}
if (data.result) {
if (data.hasOwnProperty('result')) {
onResult(resultElement, data.result);
}
ProgressSocket.close();
Expand Down

0 comments on commit cf44f9e

Please sign in to comment.