Skip to content

Commit

Permalink
cre: make loadDocument() return success or failure (#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
poire-z committed Jan 1, 2018
1 parent b7342e6 commit 81e789e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,10 @@ static int loadDocument(lua_State *L) {
doc->text_view->LoadDocument(file_name);
doc->dom_doc = doc->text_view->getDocument();

return 0;
bool loaded = false;
if (doc->dom_doc) { loaded = true ;}
lua_pushboolean(L, loaded);
return 1;
}

static int renderDocument(lua_State *L) {
Expand Down

0 comments on commit 81e789e

Please sign in to comment.