Work around coverity CID 102373
authorsvost <ya.nowa@yandex.ru>
Fri, 6 May 2016 06:55:53 +0000 (09:55 +0300)
committersvost <ya.nowa@yandex.ru>
Fri, 6 May 2016 06:55:53 +0000 (09:55 +0300)
src/ui_interface.h

index d62e64b..c56bb30 100644 (file)
@@ -105,8 +105,14 @@ extern CClientUIInterface uiInterface;
  */
 inline std::string _(const char* psz)
 {
-    boost::optional<std::string> rv = uiInterface.Translate(psz);
-    return rv ? (*rv) : psz;
+    try {
+        boost::optional<std::string> rv = uiInterface.Translate(psz);
+        return rv ? (*rv) : psz;
+    }
+    catch (const boost::bad_function_call& e) {
+        printf("Warning: %s in %s:%d\n", e.what(), __FILE__, __LINE__);
+        return psz;
+    }
 }
 
 #endif