mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
@@ -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.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user