fields_of_interest = e_data_book_view_get_fields_of_interest (book_view);
meta_contact = uid_rev_fields (fields_of_interest);
- if ( !strcmp (query, "(contains \"x-evolution-any-field\" \"\")")) {
+ if (query && !strcmp (query, "(contains \"x-evolution-any-field\" \"\")")) {
e_data_book_view_notify_progress (book_view, -1, _("Loading..."));
} else {
e_data_book_view_notify_progress (book_view, -1, _("Searching..."));
g_print ("%s - query: %s \n", type, sexp);
op = type;
vcards = e_book_backend_sqlitedb_search (ebsdb, folderid, sexp, NULL, NULL, NULL, &error);
- if (error)
+ if (error || !vcards)
return;
s_data = vcards->data;
indexed_fields = e_source_backend_summary_setup_get_indexed_fields (setup, &index_types, &n_indexed_fields);
/* No specified summary fields indicates the default summary configuration should be used */
- if (n_fields <= 0) {
+ if (n_fields <= 0 || !fields) {
ebsdb = e_book_backend_sqlitedb_new (path, emailid, folderid, folder_name, store_vcard, error);
g_free (fields);
g_free (index_types);
ptr = normal;
}
- while ((c = *ptr++)) {
+ while (ptr && (c = *ptr++)) {
if (c == '\'') {
g_string_append_c (str, '\'');
} else if ((c == '%' || c == '^') && match != MATCH_REGEX) {
match_data.as_string = TRUE;
match_data.backend = E_CAL_BACKEND (backend);
- if (!strcmp (sexp, "#t"))
+ if (sexp && !strcmp (sexp, "#t"))
match_data.search_needed = FALSE;
match_data.obj_sexp = e_cal_backend_sexp_new (sexp);
match_data.obj_sexp = e_data_cal_view_get_sexp (query);
match_data.view = query;
- if (!strcmp (match_data.query, "#t"))
+ if (match_data.query && !strcmp (match_data.query, "#t"))
match_data.search_needed = FALSE;
if (!match_data.obj_sexp) {
match_data.as_string = TRUE;
match_data.backend = E_CAL_BACKEND (cbfile);
- if (!strcmp (sexp, "#t"))
+ if (sexp && !strcmp (sexp, "#t"))
match_data.search_needed = FALSE;
match_data.obj_sexp = e_cal_backend_sexp_new (sexp);
ECalComponent *comp = e_cal_component_new_from_string (calobj);
ECalComponentId *id = e_cal_component_get_id (comp);
- e_cal_backend_store_remove_component (cbhttp->priv->store, id->uid, id->rid);
- e_cal_backend_notify_component_removed (E_CAL_BACKEND (cbhttp), id, comp, NULL);
+ if (id) {
+ e_cal_backend_store_remove_component (cbhttp->priv->store, id->uid, id->rid);
+ e_cal_backend_notify_component_removed (E_CAL_BACKEND (cbhttp), id, comp, NULL);
+
+ e_cal_component_free_id (id);
+ }
- e_cal_component_free_id (id);
g_object_unref (comp);
return TRUE;
continue;
}
- ci->start = icaltime_as_timet_with_zone (
- *dtstart.value, start_zone);
+ if (dtstart.value) {
+ ci->start = icaltime_as_timet_with_zone (
+ *dtstart.value, start_zone);
+ }
if (dtend.value)
ci->end = icaltime_as_timet_with_zone (
*dtend.value, end_zone);
- else if (icaltime_is_date (*dtstart.value))
+ else if (dtstart.value && icaltime_is_date (*dtstart.value))
ci->end = time_day_end (ci->start);
else
ci->end = ci->start;
const gchar *uid,
const gchar *rid)
{
- EIntervalNode *y;
- EIntervalNode *x;
- EIntervalNode *z;
+ EIntervalNode *y = NULL;
+ EIntervalNode *x = NULL;
+ EIntervalNode *z = NULL;
EIntervalNode *nil, *root;
gchar *key;
y = ((z->left == nil) || (z->right == nil)) ? z :
intervaltree_node_next (tree, z);
+ g_return_val_if_fail (y, FALSE);
x = (y->left == nil) ? y->right : y->left;
+ g_return_val_if_fail (x, FALSE);
/* y is to be spliced out. x is it's only child */
x->parent = y->parent;
- if (root == x->parent)
+ if (root && root == x->parent)
root->left = x;
- else {
+ else if (y->parent) {
if (y == y->parent->left)
y->parent->left = x;
else
y->parent->right = x;
}
- if (y != z) {
+ if (z && y != z) {
/* y (the succesor of z) is the node to be spliced out */
g_return_val_if_fail (y != tree->priv->nil, FALSE);
y->parent = z->parent;
z->left->parent = z->right->parent = y;
- if (z == z->parent->left)
- z->parent->left = y;
- else
- z->parent->right = y;
+ if (z->parent) {
+ if (z == z->parent->left)
+ z->parent->left = y;
+ else
+ z->parent->right = y;
+
+ }
fixup_min_max_fields (tree, x->parent);
id = e_cal_component_get_id (comp);
- e_cal_backend_cache_remove_component (cache, id->uid, id->rid);
+ if (id) {
+ e_cal_backend_cache_remove_component (cache, id->uid, id->rid);
- e_cal_backend_notify_component_removed (backend, id, comp, NULL);
+ e_cal_backend_notify_component_removed (backend, id, comp, NULL);
+
+ e_cal_component_free_id (id);
+ }
- e_cal_component_free_id (id);
g_object_unref (comp);
}