[gnome-builder] libide: ensure we have items to merge before dereferencing
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: ensure we have items to merge before dereferencing
- Date: Tue, 24 Mar 2015 05:13:17 +0000 (UTC)
commit d4e8f9687f7b8c211a8c5d46afc76f7047348919
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 23 22:13:09 2015 -0700
libide: ensure we have items to merge before dereferencing
libide/ide-back-forward-list.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libide/ide-back-forward-list.c b/libide/ide-back-forward-list.c
index 20b00c9..4a7edd1 100644
--- a/libide/ide-back-forward-list.c
+++ b/libide/ide-back-forward-list.c
@@ -309,6 +309,12 @@ ide_back_forward_list_merge (IdeBackForwardList *self,
ar1 = ide_back_forward_list_to_array (self);
ar2 = ide_back_forward_list_to_array (branch);
+ g_assert (ar1 != NULL);
+ g_assert (ar2 != NULL);
+
+ if (ar2->len == 0)
+ return;
+
first = g_ptr_array_index (ar2, 0);
for (i = 0; i < ar1->len; i++)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]