Skip to content

Commit

Permalink
Fixed #1
Browse files Browse the repository at this point in the history
"gfx.texture.load()" with a bad file name now return "nil" and an error.
  • Loading branch information
firew0lf committed Aug 21, 2015
1 parent ff6aa8e commit f580341
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/texture.c
Expand Up @@ -40,6 +40,12 @@ static int texture_load(lua_State *L) {
return 2;
}

if (texture->texture == NULL) {
lua_pushnil(L);
lua_pushstring(L, "No such file");
return 2;
}

texture->scaleX = 1.0f;
texture->scaleY = 1.0f;

Expand Down

0 comments on commit f580341

Please sign in to comment.