summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-01-05 18:34:01 +0300
committerinfirit <[email protected]>2015-01-10 21:26:02 +0100
commite0782e058b729553335cfe76f96ba556e54b7f58 (patch)
tree31c13d89d312834b2eecb6b7ea6019385bd0b383 /shell
parent54da6f16ad644abc7771d568679a12b79a890e01 (diff)
downloadatril-e0782e058b729553335cfe76f96ba556e54b7f58.tar.bz2
atril-e0782e058b729553335cfe76f96ba556e54b7f58.tar.xz
safer access to list element's data
g_list_nth_data just returns NULL if either list or element is NULL
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-history.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/shell/ev-history.c b/shell/ev-history.c
index 9b59014c..51ecb3fa 100644
--- a/shell/ev-history.c
+++ b/shell/ev-history.c
@@ -123,13 +123,9 @@ ev_history_add_link (EvHistory *history, EvLink *link)
EvLink *
ev_history_get_link_nth (EvHistory *history, int index)
{
- GList *l;
-
g_return_val_if_fail (EV_IS_HISTORY (history), NULL);
- l = g_list_nth (history->priv->links, index);
-
- return EV_LINK (l->data);
+ return EV_LINK (g_list_nth_data (history->priv->links, index));
}
int