Fixes error from mediafile-list.component when logging out

- If the user is seeing the mediafiles and wants to log out, an error occurred causing by querying an attribute from undefined object.
This commit is contained in:
GabrielMeyer 2019-04-09 15:30:49 +02:00
parent fc5f6f4e54
commit 4994cc6ce8
2 changed files with 2 additions and 2 deletions

View File

@ -117,7 +117,7 @@ export class MediaManageService {
* @param action the logo action or font action
* @returns A media config object containing the requested values
*/
public getMediaConfig(action: string): ImageConfigObject | FontConfigObject {
public getMediaConfig(action: string): ImageConfigObject | FontConfigObject | null {
return this.config.instant(action);
}
}

View File

@ -239,7 +239,7 @@ export class MediafileListComponent extends ListViewBaseComponent<ViewMediafile,
*/
public isUsedAs(file: ViewMediafile, mediaFileAction: string): boolean {
const config = this.mediaManage.getMediaConfig(mediaFileAction);
return config.path === file.downloadUrl;
return config ? config.path === file.downloadUrl : false;
}
/**