diff options
author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2022-08-25 02:50:01 +0300 |
---|---|---|
committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2022-08-25 03:41:08 +0300 |
commit | bdc5921037f2c85ca3da5031b9ab2439cbf60d15 (patch) | |
tree | b4c8811a67d5587532f2d351e115b3faa48d07b4 | |
parent | 188c0aaec5f9db6f50c57255deb7625370b79c7c (diff) |
plugins/x2go/x2go_plugin.c: Gracefully handle missing default_username param.
-rw-r--r-- | plugins/x2go/x2go_plugin.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/x2go/x2go_plugin.c b/plugins/x2go/x2go_plugin.c index fcd2f1a7c..a07a17e55 100644 --- a/plugins/x2go/x2go_plugin.c +++ b/plugins/x2go/x2go_plugin.c @@ -1695,18 +1695,21 @@ static gboolean rmplugin_x2go_get_auth(RemminaProtocolWidget *gp, gchar** errmsg g_assert(default_username != NULL); g_assert(default_password != NULL); - if (!(*default_username)) { - (*errmsg) = g_strdup_printf( - _("Internal error: %s"), - _("Parameter 'default_username' is uninitialized.") + // default_username is probably NULL because the user didn't configure any + // username in the profile settings. + if ((*default_username) == NULL) { + gchar* l_errmsg = g_strdup_printf( + _("TIP: Check the 'Save password' checkbox or manually input your " + "X2Go credentials into the profile settings to store your " + "credentials permanently and login faster next time.") ); - REMMINA_PLUGIN_CRITICAL("%s", errmsg); - return FALSE; + REMMINA_PLUGIN_MESSAGE("%s", l_errmsg); + (*default_username) = g_strdup(""); } - // We can handle ((*default_password) == NULL). - // Password is probably NULL because something did go wrong at the secret-plugin. - // For example: The user didn't input a password for keyring. + // default_password is probably NULL because something did go wrong at the + // secret-plugin. For example: The user didn't input a password for keyring or + // the user simply didn't configure a password in the profile settings. if ((*default_password) == NULL) { (*default_password) = g_strdup(""); } |