playif / play_phaser

A Dart port for Phaser 2D game engine.
MIT License
72 stars 13 forks source link

Exception: The null object does not have a method 'cancel'. #4

Closed darkoverlordofdata closed 9 years ago

darkoverlordofdata commented 9 years ago

I get this error when calling "scale.setScreenSize(true);" in ScaleManager.

This is the dart code that raises an exception: this._check.cancel();

In the original, no exception is raised here when this_check is null - Phaser.js does this: clearInterval(this._check);

Thanks, Bruce

playif commented 9 years ago

I fixed the bug by add the following check:

      if(this._check != null){
        this._check.cancel();
        this._check = null;
      }

By the way, you can set the scaleMode (to ScaleManager.EXACT_FIT or ScaleManager.SHOW_ALL) in ScaleManager and the setScreenSize will be automatically called.

please update the package to 0.10.2, and let me know if the bug is still there, thanks.