From: kwolekr Date: Tue, 24 Mar 2015 01:03:28 +0000 (-0400) Subject: Schematics: Error if unable to open file X-Git-Tag: 0.4.13~439 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a423202756744c4f09488762ed35ab24693b0f20;p=oweals%2Fminetest.git Schematics: Error if unable to open file --- diff --git a/src/mg_schematic.cpp b/src/mg_schematic.cpp index a05e372e5..23b62115f 100644 --- a/src/mg_schematic.cpp +++ b/src/mg_schematic.cpp @@ -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) {