Permalink
Browse files

Hotfix for null-pointer references on Sprite::getWidth or getHeight.

  • Loading branch information...
1 parent 19945b4 commit 2e1bd6a2da5523c31647bbef030798ab6f4c0cfc @rynti rynti committed Jul 31, 2012
Showing with 5 additions and 6 deletions.
  1. +2 −3 haxelib.xml
  2. +2 −2 org/rygal/graphic/Sprite.hx
  3. +1 −1 org/rygal/util/Utils.hx
View
5 haxelib.xml
@@ -24,8 +24,7 @@
<description>
A free open source engine for games using haXe and NME.
</description>
- <version name="1.1.6">
- Made constants inlined, added read-only properties, changed ENTER to
- RETURN and various bugfixes.
+ <version name="1.1.7">
+ Hotfix for null-pointer references on Sprite::getWidth or getHeight.
</version>
</project>
View
4 org/rygal/graphic/Sprite.hx
@@ -118,7 +118,7 @@ class Sprite extends BasicGameObject, implements PhysicalObject {
* @return The width of this sprite.
*/
private function getWidth():Int {
- return texture.width;
+ return texture == null ? 0 : texture.width;
}
/**
@@ -127,7 +127,7 @@ class Sprite extends BasicGameObject, implements PhysicalObject {
* @return The height of this sprite.
*/
private function getHeight():Int {
- return texture.height;
+ return texture == null ? 0 : texture.height;
}
}
View
2 org/rygal/util/Utils.hx
@@ -36,7 +36,7 @@ class Utils {
public static inline var VERSION_MINOR:Int = 1;
/** The revision number of the current Rygal version. (0.0.x) */
- public static inline var VERSION_REVISION:Int = 6;
+ public static inline var VERSION_REVISION:Int = 7;
/**

0 comments on commit 2e1bd6a

Please sign in to comment.