X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fstructure%2Fexception.cxx;h=af9be51648c1af0a089b85170668f0442cea5959;hb=8f9921d00c692573263a0215150e0892a9ffb68c;hp=75f4cf50d0368853b48c7ea2bd9d63a400556caf;hpb=d22640ef4e938b523bdc30cd83370977d30de856;p=simgear.git diff --git a/simgear/structure/exception.cxx b/simgear/structure/exception.cxx index 75f4cf50..af9be516 100644 --- a/simgear/structure/exception.cxx +++ b/simgear/structure/exception.cxx @@ -86,7 +86,7 @@ sg_location::asString () const { char buf[128]; string out = ""; - if (_path != (string)"") { + if (!_path.empty()) { out += _path; if (_line != -1 || _column != -1) out += ",\n"; @@ -229,8 +229,11 @@ const string sg_io_exception::getFormattedMessage () const { string ret = getMessage(); - ret += "\n at "; - ret += getLocation().asString(); + string loc = getLocation().asString(); + if (loc.length()) { + ret += "\n at "; + ret += loc; + } return ret; }