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:
@@ -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(): "
|
||||
|
||||
Reference in New Issue
Block a user