]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/exception.cxx
Mathias Fröhlich:
[simgear.git] / simgear / structure / exception.cxx
index 75f4cf50d0368853b48c7ea2bd9d63a400556caf..af9be51648c1af0a089b85170668f0442cea5959 100644 (file)
@@ -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;
 }