Sfoglia il codice sorgente

Sprite: check that sprite is loaded

SG 2 anni fa
parent
commit
54d49307f0
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      sprite.c

+ 3 - 0
sprite.c

@@ -136,5 +136,8 @@ size_t sprite_get_height(Sprite* sprite) {
 }
 
 void canvas_draw_sprite(Canvas* canvas, Sprite* sprite, int32_t x, int32_t y) {
+    furi_check(sprite->width);
+    furi_check(sprite->height);
+    furi_check(sprite->data);
     canvas_draw_xbm(canvas, x, y, sprite->width, sprite->height, sprite->data);
 }