fix: File provider not erroring out correctly when selecting a folder to open

This commit is contained in:
WerWolv
2025-12-23 10:51:52 +01:00
parent ea359285e0
commit 8e7bd4b98a
2 changed files with 4 additions and 0 deletions

View File

@@ -235,6 +235,9 @@ namespace hex::plugin::builtin {
m_readable = true;
m_writable = true;
if (wolv::io::fs::isDirectory(m_path))
return OpenResult::failure(fmt::format("hex.builtin.provider.file.error.is_directory"_lang, m_path.string()));
wolv::io::File file(m_path, wolv::io::File::Mode::Write);
if (!file.isValid()) {
m_writable = false;