This commit is contained in:
2025-12-13 02:33:12 -05:00
parent 61275d9e75
commit 4977f4476c
3 changed files with 31 additions and 2 deletions

View File

@@ -23,7 +23,9 @@ namespace anm2ed::anm2
{
XMLDocument document;
if (document.LoadFile(path.string().c_str()) != XML_SUCCESS)
filesystem::File file{path, "rb"};
if (!file.get() || document.LoadFile(file.get()) != XML_SUCCESS)
{
if (errorString) *errorString = document.ErrorStr();
return;
@@ -56,7 +58,9 @@ namespace anm2ed::anm2
XMLDocument document;
document.InsertFirstChild(to_element(document));
if (document.SaveFile(path.string().c_str()) != XML_SUCCESS)
filesystem::File file{path, "w"};
if (!file.get() || document.SaveFile(file.get()) != XML_SUCCESS)
{
if (errorString) *errorString = document.ErrorStr();
return false;