App: Fix PropertyFileIncluded::SaveDocFile

Before trying to access the filename check whether it isn't set.
In this case print a warning and return.
This commit is contained in:
wmayer
2026-02-23 10:12:38 +01:00
committed by Ladislav Michl
parent af5c40d8e8
commit 0eb01c636c
+7 -1
View File
@@ -429,7 +429,13 @@ void PropertyFileIncluded::Restore(Base::XMLReader& reader)
void PropertyFileIncluded::SaveDocFile(Base::Writer& writer) const
{
Base::ifstream from(Base::FileInfo(_cValue.c_str()), std::ios::in | std::ios::binary);
if (_cValue.empty()) {
Base::Console().warning("Empty filename in PropertyFileIncluded::SaveDocFile. "
"Nothing to do.\n");
return;
}
Base::ifstream from(Base::FileInfo(_cValue), std::ios::in | std::ios::binary);
if (!from) {
std::stringstream str;
str << "PropertyFileIncluded::SaveDocFile(): "