#599: Don't crash when a path does not exist.
This commit is contained in:
parent
cee8c5b5c7
commit
21f2e1f250
@ -490,6 +490,11 @@ std::string SGPath::realpath() const
|
|||||||
return path;
|
return path;
|
||||||
#else
|
#else
|
||||||
char* buf = ::realpath(path.c_str(), NULL);
|
char* buf = ::realpath(path.c_str(), NULL);
|
||||||
|
if (!buf)
|
||||||
|
{
|
||||||
|
SG_LOG(SG_IO, SG_ALERT, "ERROR: The path '" << path << "' does not exist in the file system.");
|
||||||
|
return path;
|
||||||
|
}
|
||||||
std::string p(buf);
|
std::string p(buf);
|
||||||
free(buf);
|
free(buf);
|
||||||
return p;
|
return p;
|
||||||
|
Loading…
Reference in New Issue
Block a user