Parcourir la source

One very important null-check.

Adam Blake il y a 13 ans
Parent
commit
2b728d0636
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      gameplay/src/Control.cpp

+ 1 - 2
gameplay/src/Control.cpp

@@ -688,13 +688,12 @@ namespace gameplay
 
 
     void Control::drawBorder(SpriteBatch* spriteBatch, const Rectangle& clip)
     void Control::drawBorder(SpriteBatch* spriteBatch, const Rectangle& clip)
     {
     {
-        if (_bounds.width <= 0 || _bounds.height <= 0)
+        if (!_skin || _bounds.width <= 0 || _bounds.height <= 0)
             return;
             return;
 
 
         Vector2 pos(clip.x + _bounds.x, clip.y + _bounds.y);
         Vector2 pos(clip.x + _bounds.x, clip.y + _bounds.y);
 
 
         // Get the border and background images for this control's current state.
         // Get the border and background images for this control's current state.
-        //Theme::UVs topLeft, top, topRight, left, center, right, bottomLeft, bottom, bottomRight;
         const Theme::UVs& topLeft = _skin->getUVs(Theme::Skin::TOP_LEFT);
         const Theme::UVs& topLeft = _skin->getUVs(Theme::Skin::TOP_LEFT);
         const Theme::UVs& top = _skin->getUVs(Theme::Skin::TOP);
         const Theme::UVs& top = _skin->getUVs(Theme::Skin::TOP);
         const Theme::UVs& topRight = _skin->getUVs(Theme::Skin::TOP_RIGHT);
         const Theme::UVs& topRight = _skin->getUVs(Theme::Skin::TOP_RIGHT);