Skip to content

Commit 689c8c7

Browse files
committed
Prevent infinite loading when no font is specified
1 parent c6abf9d commit 689c8c7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phaser-webpack-loader",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"author": "GoldFire Studios, Inc. (http://goldfirestudios.com)",
55
"description": "Asset loader for Phaser + Webpack.",
66
"author": "James Simpson <[email protected]> (http://goldfirestudios.com)",

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ export default class WebpackLoader extends Phaser.Plugin {
7575
* @return {Promise} Returns when fonts are ready to use.
7676
*/
7777
_loadFonts() {
78+
if (Object.keys(this.fonts).length === 0) {
79+
return Promise.resolve();
80+
}
81+
7882
return new Promise((resolve) => {
7983
WebFont.load(Object.assign({}, this.fonts, {
8084
active: resolve,

0 commit comments

Comments
 (0)