plattysoft / Leonids

A Particle System for standard Android UI: http://plattysoft.github.io/Leonids/
Apache License 2.0
2.28k stars 398 forks source link

NPE #75

Closed yperess closed 7 years ago

yperess commented 7 years ago

I got the following error while using the particle emitted with the following settings:

                if (mParticleSystem == null) {
                    mParticleSystem = new ParticleSystem(getActivity(), 100 /* maxParticles */,
                            R.drawable.particle_white_bubble, 3000L /* timeToLive */);
                    mParticleSystem.emit(emitLeft ? 0 : mScreenSize.x, mScreenSize.y / 2,
                            12 /* particlesPerSecond */);
                } else {
                    mParticleSystem.updateEmitPoint(emitLeft ? 0 : mScreenSize.x,
                            mScreenSize.y / 2);
                }
                mParticleSystem.setSpeedModuleAndAngleRange(0f, 0.1f,
                        emitLeft ? 315 : 90, emitLeft ? 90 : 225)
                        .setScaleRange(0.9f, 1.1f)
                        .addModifier(new ScaleModifier(0f, 1f, 0L, 3000L))
                        .setFadeOut(3000L);
03-25 18:39:41.011 18926-19661/com.example E/Metaverse: Attempt to invoke interface method 'void com.plattysoft.leonids.initializers.ParticleInitializer.initParticle(com.plattysoft.leonids.Particle, java.util.Random)' on a null object reference
03-25 18:39:41.011 18926-19661/com.example W/System.err: java.lang.NullPointerException: Attempt to invoke interface method 'void com.plattysoft.leonids.initializers.ParticleInitializer.initParticle(com.plattysoft.leonids.Particle, java.util.Random)' on a null object reference
03-25 18:39:41.012 18926-19661/com.example W/System.err:     at com.plattysoft.leonids.ParticleSystem.activateParticle(ParticleSystem.java:644)
03-25 18:39:41.013 18926-19661/com.example W/System.err:     at com.plattysoft.leonids.ParticleSystem.onUpdate(ParticleSystem.java:671)
03-25 18:39:41.013 18926-19661/com.example W/System.err:     at com.plattysoft.leonids.ParticleSystem.access$100(ParticleSystem.java:38)
03-25 18:39:41.013 18926-19661/com.example W/System.err:     at com.plattysoft.leonids.ParticleSystem$ParticleTimerTask.run(ParticleSystem.java:82)
03-25 18:39:41.013 18926-19661/com.example W/System.err:     at java.util.TimerThread.mainLoop(Timer.java:555)
03-25 18:39:41.013 18926-19661/com.example W/System.err:     at java.util.TimerThread.run(Timer.java:505)