From 03e773f184d340c0a4ff5c914cf7da0150a27a1a Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Wed, 14 Feb 2024 12:11:04 +0100 Subject: [PATCH] Prevent crash if H5P Integration does not provide file icon --- scripts/h5peditor-init.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/h5peditor-init.js b/scripts/h5peditor-init.js index a78f6d34..dbdf74b0 100644 --- a/scripts/h5peditor-init.js +++ b/scripts/h5peditor-init.js @@ -2,7 +2,11 @@ H5PEditor.init = function ($form, $type, $upload, $create, $editor, $library, $params, $maxScore, $title, cancelSubmitCallback) { H5PEditor.$ = H5P.jQuery; H5PEditor.basePath = H5PIntegration.editor.libraryUrl; - H5PEditor.fileIcon = H5PIntegration.editor.fileIcon; + H5PEditor.fileIcon = H5PIntegration.editor.fileIcon ?? { + path: `${H5PEditor.basePath}/images/binary-file.png`, + width: 50, + height:50 + }; H5PEditor.ajaxPath = H5PIntegration.editor.ajaxPath; H5PEditor.filesPath = H5PIntegration.editor.filesPath; H5PEditor.apiVersion = H5PIntegration.editor.apiVersion;