summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sbmanager.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c
index 5ef3d04..ed860eb 100644
--- a/src/sbmanager.c
+++ b/src/sbmanager.c
@@ -647,9 +647,13 @@ static void redraw_icons()
static GList *insert_into_icon_list(GList *iconlist, SBItem *newitem, gfloat item_x, gfloat item_y)
{
- if (!newitem || !iconlist) {
+ if (!newitem) {
return iconlist;
}
+ if (!iconlist) {
+ /* for empty lists just add the element */
+ return g_list_append(iconlist, newitem);
+ }
gint i;
gint count = g_list_length(iconlist);
gint newpos = count;
@@ -682,7 +686,7 @@ static GList *insert_into_icon_list(GList *iconlist, SBItem *newitem, gfloat ite
}
}
- return g_list_insert(iconlist, selected_item, newpos);
+ return g_list_insert(iconlist, newitem, newpos);
}
static gboolean stage_motion(ClutterActor *actor, ClutterMotionEvent *event, gpointer user_data)