Prevent error if favicon not found

This commit is contained in:
Adrian Vollmer 2022-10-09 12:39:56 +02:00
parent 3cbcb667db
commit 2ec9ca7749

View File

@ -28,6 +28,7 @@ var set_favicon = function(href) {
favicon.setAttribute('rel', 'shortcut icon');
href = normalize_path(href);
const file = window.global_context.file_tree[href];
if (!file) {return;}
if (file.mime_type == 'image/svg+xml') {
favicon.setAttribute('href', 'data:' + file.mime_type + ';charset=utf-8;base64,' + btoa(file.data));
favicon.setAttribute('type', file.mime_type);