Filemanager: Try to avoid type error in list when mime is missing

Uncaught TypeError: Cannot read properties of null (reading 'mime_odf_regex')
    at collaboraFilemanagerAPP.isEditable (filemanager.ts:1566:38)
This commit is contained in:
nathan 2023-08-23 10:40:47 -06:00
parent 4420e9662d
commit d54eb8e388

View File

@ -1559,7 +1559,10 @@ export class filemanagerAPP extends EgwApp
let data = egw.dataGetUIDdata(_senders[0].id);
let mime = this.et2.getInstanceManager().widgetContainer.getWidgetById('$row');
let fe = egw.file_editor_prefered_mimes(data.data.mime);
if (fe && fe.mime && !fe.mime[data.data.mime]) return false;
if(!mime || fe && fe.mime && !fe.mime[data.data.mime])
{
return false;
}
return !!data.data.mime.match(mime.mime_odf_regex);
}