Skip to content

Commit 9abacde

Browse files
committed
fix stats error
1 parent 9033b13 commit 9abacde

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/scripts/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@ class Game {
126126
}
127127

128128
animate () {
129-
this.stats.begin()
130-
this.render()
131-
this.stats.end()
129+
try {
130+
this.stats.begin()
131+
this.render()
132+
this.stats.end()
133+
} catch (e) {
134+
this.render()
135+
}
136+
132137
window.requestAnimationFrame(() => {
133138
this.animate()
134139
})

0 commit comments

Comments
 (0)