Skip to content

Commit 6d0b7e9

Browse files
ChumperNils Plaschke
authored andcommitted
Added additional check for node
If `process` is defined, but it has no `versions` property the check will fail with an error. The detection of node is not working properly. In my case I have embedded phaser into a vue-cli@3 application, which is technically node but has no `versions` property. This fixes the problem
1 parent c8bbea5 commit 6d0b7e9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/device/OS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function init ()
134134
OS.cordova = true;
135135
}
136136

137-
if ((typeof process !== 'undefined') && (typeof process.versions.node !== 'undefined'))
137+
if (process && process.versions && process.versions.node)
138138
{
139139
OS.node = true;
140140
}

0 commit comments

Comments
 (0)