MVC: SimpleActionButton, add catch undefined TypeError (#5848)

* Add condition for data existing before others
  catches Uncaught TypeError: data.status is undefined
This commit is contained in:
agh1467 2022-07-04 02:32:57 -04:00 committed by GitHub
parent 816f20f0e5
commit ae4e8ae4e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -571,7 +571,7 @@ $.fn.SimpleActionButton = function (params) {
if (params && params.onAction) {
params.onAction(data, status);
}
if ((status != "success" || data['status'].toLowerCase().trim() != 'ok') && data['status']) {
if ((status != "success" || ('status' in data && data['status'].toLowerCase().trim() != 'ok')) && data['status']) {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: this_button.data('error-title'),