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
This commit is contained in:
Nils Plaschke 2018-04-13 15:01:31 +02:00 committed by Nils Plaschke
parent c8bbea552d
commit 6d0b7e91ab

View file

@ -134,7 +134,7 @@ function init ()
OS.cordova = true;
}
if ((typeof process !== 'undefined') && (typeof process.versions.node !== 'undefined'))
if (process && process.versions && process.versions.node)
{
OS.node = true;
}