fix: Crash when opening invalid files through the CLI
This commit is contained in:
parent
93c8a45de0
commit
afceb34729
@ -75,8 +75,12 @@ namespace hex::plugin::builtin {
|
||||
if (arg == "--" && !doubleDashFound) {
|
||||
doubleDashFound = true;
|
||||
} else {
|
||||
auto path = std::filesystem::weakly_canonical(arg);
|
||||
fullPaths.push_back(wolv::util::toUTF8String(path));
|
||||
try {
|
||||
auto path = std::filesystem::weakly_canonical(arg);
|
||||
fullPaths.push_back(wolv::util::toUTF8String(path));
|
||||
} catch (std::exception &e) {
|
||||
log::error("Failed to open file '{}'\n {}", arg, e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user