Navigation Menu

Skip to content

Commit

Permalink
Schematics: Error if unable to open file
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed Mar 24, 2015
1 parent 11372ac commit a423202
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mg_schematic.cpp
Expand Up @@ -207,6 +207,11 @@ bool Schematic::loadSchematicFromFile(const char *filename, INodeDefManager *nde
bool have_cignore = false;

std::ifstream is(filename, std::ios_base::binary);
if (!is.good()) {
errorstream << "loadSchematicFile: unable to open file '"
<< filename << "'" << std::endl;
return false;
}

u32 signature = readU32(is);
if (signature != MTSCHEM_FILE_SIGNATURE) {
Expand Down

0 comments on commit a423202

Please sign in to comment.