From: ehofman Date: Fri, 19 Dec 2003 17:44:30 +0000 (+0000) Subject: Melchior FRANZ: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6a19bbee7d7380167844296221130bf7421e8248;p=simgear.git Melchior FRANZ: There are constructors for sg_io_exception that don't initialize the location. In this case getFormattedMessage does still output an extra line with " at" followed by ... nothing. Looks silly. --- diff --git a/simgear/structure/exception.cxx b/simgear/structure/exception.cxx index d7c83b08..af9be516 100644 --- a/simgear/structure/exception.cxx +++ b/simgear/structure/exception.cxx @@ -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; }