Skip to content

Commit

Permalink
fix: check whether skap ptr is initialized before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed Jun 20, 2024
1 parent e49ac44 commit cc4c5e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sk_image.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Image sk_image_load(const char *filename) {
#ifndef NDEBUG
return LoadImage(filename);
#else
if (!skap) SK_LOG_ERROR("sk_image_load :: SKAP was not initialized (maybe forgot to exec `sk_image_init` ?)");
Image img = {0};
if (!sk_assetpack_lookup(skap, SK_ASSETPACK_BLOB_KIND_IMAGE, filename, &img)) {
SK_LOG_ERROR("sk_image_load :: unable to retrieve image from SKAP file");
Expand Down

0 comments on commit cc4c5e7

Please sign in to comment.