little fix for more error handling
This commit is contained in:
parent
7666f39406
commit
73968ae317
@ -399,6 +399,8 @@ Serializable* ObjectLoader::quickLoad(std::string filename, std::string type, bo
|
|||||||
std::fstream file;
|
std::fstream file;
|
||||||
auto mode = binary ? std::ios_base::in | std::ios_base::binary : std::ios_base::in;
|
auto mode = binary ? std::ios_base::in | std::ios_base::binary : std::ios_base::in;
|
||||||
file.open(filename, mode);
|
file.open(filename, mode);
|
||||||
|
if(!file.is_open())
|
||||||
|
return nullptr;
|
||||||
ObjectLoader loader;
|
ObjectLoader loader;
|
||||||
loader.loadAscii(file);
|
loader.loadAscii(file);
|
||||||
file.close();
|
file.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user