Skip to content

Commit 03e773f

Browse files
committed
Prevent crash if H5P Integration does not provide file icon
1 parent 9503dec commit 03e773f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/h5peditor-init.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
H5PEditor.init = function ($form, $type, $upload, $create, $editor, $library, $params, $maxScore, $title, cancelSubmitCallback) {
33
H5PEditor.$ = H5P.jQuery;
44
H5PEditor.basePath = H5PIntegration.editor.libraryUrl;
5-
H5PEditor.fileIcon = H5PIntegration.editor.fileIcon;
5+
H5PEditor.fileIcon = H5PIntegration.editor.fileIcon ?? {
6+
path: `${H5PEditor.basePath}/images/binary-file.png`,
7+
width: 50,
8+
height:50
9+
};
610
H5PEditor.ajaxPath = H5PIntegration.editor.ajaxPath;
711
H5PEditor.filesPath = H5PIntegration.editor.filesPath;
812
H5PEditor.apiVersion = H5PIntegration.editor.apiVersion;

0 commit comments

Comments
 (0)