[libgda/LIBGDA_4.2] Virtual connection: added check instead of crash
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_4.2] Virtual connection: added check instead of crash
- Date: Tue, 24 May 2011 21:11:03 +0000 (UTC)
commit f9408e4f41a63fe44695f1370410aa0e79587641
Author: Vivien Malerba <malerba gnome-db org>
Date: Tue May 24 23:10:09 2011 +0200
Virtual connection: added check instead of crash
libgda/sqlite/virtual/gda-vprovider-data-model.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libgda/sqlite/virtual/gda-vprovider-data-model.c b/libgda/sqlite/virtual/gda-vprovider-data-model.c
index 02a5807..93ef15a 100644
--- a/libgda/sqlite/virtual/gda-vprovider-data-model.c
+++ b/libgda/sqlite/virtual/gda-vprovider-data-model.c
@@ -416,7 +416,11 @@ virtualCreate (sqlite3 *db, void *pAux, int argc, const char *const *argv, sqlit
td = gda_vconnection_get_table_data_by_unique_name (cnc, spec_name);
g_free (spec_name);
- g_assert (td);
+ if (!td) {
+ /* wrong usage! */
+ *pzErr = SQLITE3_CALL (sqlite3_mprintf) (_("Wrong usage of Libgda's virtual tables"));
+ return SQLITE_ERROR;
+ }
/* preparations */
if (td->spec->data_model) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]