Skip to content

Commit bb9cfec

Browse files
committed
fix(progress-bar): avoid error on SSR if pathname is undefined (#12807)
1 parent 22ae587 commit bb9cfec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/progress-bar/progress-bar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements CanColor
9494
// `Location` from `@angular/common` since we can't tell the difference between whether
9595
// the consumer is using the hash location strategy or not, because `Location` normalizes
9696
// both `/#/foo/bar` and `/foo/bar` to the same thing.
97-
const path = location ? location.pathname.split('#')[0] : '';
97+
const path = location && location.pathname ? location.pathname.split('#')[0] : '';
9898
this._rectangleFillValue = `url('${path}#${this.progressbarId}')`;
9999
}
100100

0 commit comments

Comments
 (0)