Skip to content

Commit 1934ce4

Browse files
Merge pull request #58 from LottieFiles/feature/window-check
fix(player): added null check on window
2 parents 0fd2733 + b1498ae commit 1934ce4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Player.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export class Player extends React.Component<IPlayerProps, IPlayerState> {
110110

111111
constructor(props: IPlayerProps) {
112112
super(props);
113-
window.lottie = lottie;
113+
114+
if (typeof window !== 'undefined') {
115+
window.lottie = lottie;
116+
}
114117
this.state = {
115118
animationData: null,
116119
background: 'transparent',

0 commit comments

Comments
 (0)