Don't create error messages when there is no error
authorDarren <darren@darrenwhitlen.com>
Mon, 4 Aug 2014 15:57:31 +0000 (16:57 +0100)
committerDarren <darren@darrenwhitlen.com>
Mon, 4 Aug 2014 15:57:31 +0000 (16:57 +0100)
client/src/misc/clientuicommands.js

index e20b387bb7ede259f6cfb8c17a6c981dd3b69efc..d6fdc5b0b0c852b439739f8fd2e89de7978a43c2 100644 (file)
             ssl: ssl,
             password: password
         }, function(err, new_connection) {
-            var translated_err_text = {text: translateText('client_models_application_connection_error', [server, port.toString(), err.toString()])};
+            var translated_err;
 
             if (err) {
-                that.app.panels().active.addMsg('', styleText('server_connecting_error', translated_err_text));
+                translated_err = translateText('client_models_application_connection_error', [server, port.toString(), err.toString()]);
+                that.app.panels().active.addMsg('', styleText('server_connecting_error', {text: translated_err}));
             }
         });
     }