Don't crash JS when there are no data-export-options (as is true in Dashboard)

This commit is contained in:
Brady Wetherington 2022-03-27 07:18:12 +01:00
parent 639409fb3f
commit e50ad8a442

View file

@ -31,7 +31,8 @@
}
$('.snipe-table').bootstrapTable('destroy').each(function () {
export_options = JSON.parse($(this).attr('data-export-options'));
data_export_options = $(this).attr('data-export-options');
export_options = data_export_options? JSON.parse(data_export_options): {};
export_options['htmlContent'] = true; //always enforce this on the given data-export-options (to prevent XSS)
$(this).bootstrapTable({