From ea2be9363a3a84a55f5902283247dda018aeb0cd Mon Sep 17 00:00:00 2001 From: Neil Crow Date: Sun, 8 Sep 2024 15:23:10 +0100 Subject: [PATCH] Add guard for error handling (#1159) * Add guard for error handling fixes #1158 * Fix lint errors * Update changelog --------- Co-authored-by: crowne Co-authored-by: Martin Wendt --- CHANGELOG.md | 5 +++-- src/jquery.fancytree.js | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ec75a16..0a5bdb80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # 2.38.4-0 / Unreleased -- [Changed] #1143 Improve the appearance of vertical connectors of skin XP -- [Fixed] [#1157](https://github.com/mar10/fancytree/issues/1157) Sporadic error restoring expansion +- [Changed] #1143 Improve the appearance of vertical connectors of skin XP +- [Fixed] [#1157](https://github.com/mar10/fancytree/issues/1157) Sporadic error restoring expansion +- [Fixed] [#1158](https://github.com/mar10/fancytree/issues/1158) Add guard for error handling # 2.38.3 / 2023-02-01 diff --git a/src/jquery.fancytree.js b/src/jquery.fancytree.js index 8dbd1aac..47e41a48 100644 --- a/src/jquery.fancytree.js +++ b/src/jquery.fancytree.js @@ -180,7 +180,9 @@ // #1041: Raised exceptions may not be visible in the browser // console if inside promise chains, so we also print directly: - $.ui.fancytree.error(msg); + if ($.ui && $.ui.fancytree) { + $.ui.fancytree.error(msg); + } // Throw exception: $.error(msg);