[libgda/LIBGDA_5.2] DsnAssistant: don't crash if no provider is found



commit a26d25a0ade1032d4147f77fbfc1d323cb8ac6cb
Author: Daniel Espinosa <esodan gmail com>
Date:   Thu Oct 10 19:05:21 2019 -0500

    DsnAssistant: don't crash if no provider is found

 control-center/gdaui-dsn-assistant.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/control-center/gdaui-dsn-assistant.c b/control-center/gdaui-dsn-assistant.c
index b697e0a1a..3946796fc 100644
--- a/control-center/gdaui-dsn-assistant.c
+++ b/control-center/gdaui-dsn-assistant.c
@@ -385,13 +385,15 @@ forward_page_function (gint current_page, GdauiDsnAssistant *assistant)
                GdaProviderInfo *pinfo;
                const gchar *provider;
                provider = gdaui_provider_selector_get_provider (GDAUI_PROVIDER_SELECTOR 
(assistant->priv->general_provider));
-               g_assert (provider);
+               if (provider != NULL) {
                pinfo = gda_config_get_provider_info (provider);
-               g_assert (pinfo);
-               if (pinfo->auth_params && pinfo->auth_params->holders) 
-                       return PAGE_AUTH_INFO;
-               else
-                       return PAGE_LAST;
+                       if (pinfo != NULL) {
+                               if (pinfo->auth_params && pinfo->auth_params->holders)
+                                       return PAGE_AUTH_INFO;
+                               else
+                                       return PAGE_LAST;
+                       }
+               }
        }
        case PAGE_AUTH_INFO:
                return PAGE_LAST;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]