From cde9b85e6b18809cafa42b6da12f8bd4b1657b3d Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 19 Sep 2001 22:10:43 +0000 Subject: Confirm row count here. (etsm_get_row_count): Make sure etsm->model isn't 2001-09-19 Christopher James Lahey * e-table-selection-model.c (add_model): Confirm row count here. (etsm_get_row_count): Make sure etsm->model isn't NULL here. If it is, it's not an error. Return 0 in this case. svn path=/trunk/; revision=12993 --- widgets/table/e-table-selection-model.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'widgets') diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index dfeaac532c..56fa07213a 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -174,6 +174,7 @@ add_model(ETableSelectionModel *etsm, ETableModel *model) etsm->model_rows_deleted_id = gtk_signal_connect(GTK_OBJECT(model), "model_rows_deleted", GTK_SIGNAL_FUNC(model_rows_deleted), etsm); } + e_selection_model_array_confirm_row_count(E_SELECTION_MODEL_ARRAY(etsm)); } inline static void @@ -292,5 +293,8 @@ etsm_get_row_count (ESelectionModelArray *esma) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL(esma); - return e_table_model_row_count (etsm->model); + if (etsm->model) + return e_table_model_row_count (etsm->model); + else + return 0; } -- cgit