From 367a91cb51aeb530c67f945153307479b78ca390 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 2 Aug 2014 10:28:22 +0200 Subject: [PATCH] Show error message if DB chart could not be loaded --- src/ag-window.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ag-window.c b/src/ag-window.c index d37c642..aa0c80b 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -1037,9 +1037,22 @@ ag_window_list_item_activated_cb(GdMainView *view, ); ag_window_change_tab(window, "chart"); + + return FALSE; } - priv->saved_data = ag_db_get_chart_data_by_id(db, row_id, NULL); + if ((priv->saved_data = ag_db_get_chart_data_by_id( + db, + row_id, + &err)) == NULL) { + ag_app_message_dialog( + GTK_WIDGET(window), + GTK_MESSAGE_ERROR, + "Could not open chart." + ); + + return FALSE; + } if (priv->chart) { g_object_unref(priv->chart);