Rogue null check borked the creation of emitters when a null frame was specified.

This commit is contained in:
Richard Davey 2017-11-17 13:30:07 +00:00
parent 153d1a113a
commit d74018f3d0

View file

@ -33,7 +33,8 @@ var ParticleEmitterManager = new Class({
this.frame = null;
this.frameNames = [];
if (typeof frame === 'object' || Array.isArray(frame))
// frame is optional and can contain the emitters array or object if skipped
if (frame !== null && (typeof frame === 'object' || Array.isArray(frame)))
{
emitters = frame;
frame = null;
@ -45,7 +46,7 @@ var ParticleEmitterManager = new Class({
this.wells = new List(this);
if (emitters !== undefined)
if (emitters)
{
// An array of emitter configs?
if (!Array.isArray(emitters))