Skip to content

Commit

Permalink
ov-components: Avoid null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Jul 26, 2024
1 parent 3f1334b commit 52564b5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,12 @@ export class OpenViduComponentsConfigService {
* @returns The base href of the application as a string.
*/
getBaseHref(): string {
const baseHref = this.document.getElementsByTagName('base')[0].href;
const base = this.document.getElementsByTagName('base');
if (!base || base.length === 0) {
return '/';
}

const baseHref = base[0].href;
if (baseHref) {
return baseHref;
}
Expand Down

0 comments on commit 52564b5

Please sign in to comment.