From e50ad8a442f92d883431ba5ee5e6f296878df7f8 Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Sun, 27 Mar 2022 07:18:12 +0100 Subject: [PATCH] Don't crash JS when there are no data-export-options (as is true in Dashboard) --- resources/views/partials/bootstrap-table.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 8919f7b6a7..ceb1fa045c 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -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({