From 7033b6981dda14051769f8518c1e2b5a92c46853 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 2 Dec 2024 10:56:34 +0100 Subject: [PATCH] Bug 38255: Early return if the node does not exist Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 5a4f069f4a1..b12f66f803d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1032,6 +1032,9 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ $.fn.kohaTable = function(options, table_settings, add_filters, default_filters, filters_options, external_filter_nodes) { var settings = null; + // Early return if the node does not exist + if (!this.length) return; + if(options) { // Don't redefine the default initComplete if ( options.initComplete ) { -- 2.34.1