Fixed API crash when writing a minimal list.

If the parent directory doesn't exist, an exception gets thrown without
this check.
This commit is contained in:
WrinklyNinja
2014-08-17 08:47:30 +01:00
parent ca907e633c
commit e21e8d8c1d
+3
View File
@@ -671,6 +671,9 @@ LOOT_API unsigned int loot_write_minimal_list (loot_db db, const char * const ou
if (db == nullptr || outputFile == nullptr)
return c_error(loot_error_invalid_args, "Null pointer passed.");
if (!boost::filesystem::exists(boost::filesystem::path(outputFile).parent_path()))
return c_error(loot_error_invalid_args, "Output directory does not exist.");
if (boost::filesystem::exists(outputFile) && !overwrite)
return c_error(loot_error_invalid_args, "Output file exists but overwrite is not set to true.");