From 9bfff051bd3ad45e3a3053525503f3f947a975a2 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 --- 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 0b0aee27cf7..5ed1e001ba2 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1023,6 +1023,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