[tracker/tracker-0.6] Bug NB#138043 - New tracker indexer crashes.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.6] Bug NB#138043 - New tracker indexer crashes.
- Date: Wed, 9 Sep 2009 12:08:18 +0000 (UTC)
commit 21d6a49b7c5f0a1d166182ad1df562b0a1ad5e78
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Sep 9 14:07:37 2009 +0200
Bug NB#138043 - New tracker indexer crashes.
Conceivably a row in the resultset could be NULL if there were NULL or
unrecognized values in the DB for all colunms in that row. In that case warn
and return NULL/0.
src/libtracker-db/tracker-db-interface.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface.c b/src/libtracker-db/tracker-db-interface.c
index 8ab7283..c0d1860 100644
--- a/src/libtracker-db/tracker-db-interface.c
+++ b/src/libtracker-db/tracker-db-interface.c
@@ -665,6 +665,12 @@ tracker_db_result_set_get (TrackerDBResultSet *result_set,
row = g_ptr_array_index (priv->array, priv->current_row);
va_start (args, result_set);
+ if (!row) {
+ g_warning ("No data was allocated for row %d, this means the database "
+ "contained NULL or non-managed values for all the data in it",
+ priv->current_row);
+ }
+
while ((n_col = va_arg (args, gint)) >= 0) {
if ((guint) n_col >= priv->columns) {
g_critical ("Result set has %d columns, trying to access column %d, "
@@ -673,7 +679,7 @@ tracker_db_result_set_get (TrackerDBResultSet *result_set,
break;
}
- if (priv->col_types[n_col] != G_TYPE_INVALID) {
+ if (row && row[n_col] && priv->col_types[n_col] != G_TYPE_INVALID) {
g_value_init (&value, priv->col_types[n_col]);
fill_in_value (&value, row[n_col]);
G_VALUE_LCOPY (&value, args, 0, &error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]