Merge pull request #4580 from GabrielInTheWorld/form-validation

Fixes error from `mediafile-list.component` when logging out
This commit is contained in:
Finn Stutzenstein 2019-04-12 07:12:58 +02:00 committed by GitHub
commit b05cd3af5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}
/**