$OpenBSD: patch-e-util_e-source-selector_c,v 1.2 2013/06/09 10:00:45 ajacoutot Exp $

From f0ee8d9c24fc1725408ddcddb68a6938562749cc Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Tue, 14 May 2013 10:02:32 +0000
Subject: Bug #699980 - Calendar delete does not remove events from view

--- e-util/e-source-selector.c.orig	Mon May 20 21:34:52 2013
+++ e-util/e-source-selector.c	Sun Jun  9 11:22:49 2013
@@ -1607,6 +1607,11 @@ e_source_selector_select_source (ESourceSelector *sele
 	/* Make sure the ESource is in our tree model. */
 	source_index = selector->priv->source_index;
 	reference = g_hash_table_lookup (source_index, source);
+
+	/* can be NULL when the source was just removed */
+	if (!reference)
+		return;
+
 	g_return_if_fail (gtk_tree_row_reference_valid (reference));
 
 	class = E_SOURCE_SELECTOR_GET_CLASS (selector);
