mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-06 19:45:27 +00:00
Prevent error if favicon not found
This commit is contained in:
parent
3cbcb667db
commit
2ec9ca7749
@ -28,6 +28,7 @@ var set_favicon = function(href) {
|
|||||||
favicon.setAttribute('rel', 'shortcut icon');
|
favicon.setAttribute('rel', 'shortcut icon');
|
||||||
href = normalize_path(href);
|
href = normalize_path(href);
|
||||||
const file = window.global_context.file_tree[href];
|
const file = window.global_context.file_tree[href];
|
||||||
|
if (!file) {return;}
|
||||||
if (file.mime_type == 'image/svg+xml') {
|
if (file.mime_type == 'image/svg+xml') {
|
||||||
favicon.setAttribute('href', 'data:' + file.mime_type + ';charset=utf-8;base64,' + btoa(file.data));
|
favicon.setAttribute('href', 'data:' + file.mime_type + ';charset=utf-8;base64,' + btoa(file.data));
|
||||||
favicon.setAttribute('type', file.mime_type);
|
favicon.setAttribute('type', file.mime_type);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user