@@ -1325,10 +1325,15 @@ GSList *dt_mouse_action_create_simple(GSList *actions,
1325
1325
const char * const description )
1326
1326
{
1327
1327
dt_mouse_action_t * a = (dt_mouse_action_t * )calloc (1 , sizeof (dt_mouse_action_t ));
1328
- a -> action = type ;
1329
- a -> mods = accel ;
1330
- g_strlcpy (a -> name , description , sizeof (a -> name ));
1331
- return g_slist_append (actions , a );
1328
+ if (a )
1329
+ {
1330
+ a -> action = type ;
1331
+ a -> mods = accel ;
1332
+ g_strlcpy (a -> name , description , sizeof (a -> name ));
1333
+ return g_slist_append (actions , a );
1334
+ }
1335
+ else
1336
+ return actions ;
1332
1337
}
1333
1338
1334
1339
GSList * dt_mouse_action_create_format (GSList * actions ,
@@ -1338,10 +1343,15 @@ GSList *dt_mouse_action_create_format(GSList *actions,
1338
1343
const char * const replacement )
1339
1344
{
1340
1345
dt_mouse_action_t * a = (dt_mouse_action_t * )calloc (1 , sizeof (dt_mouse_action_t ));
1341
- a -> action = type ;
1342
- a -> mods = accel ;
1343
- g_snprintf (a -> name , sizeof (a -> name ), format_string , replacement );
1344
- return g_slist_append (actions , a );
1346
+ if (a )
1347
+ {
1348
+ a -> action = type ;
1349
+ a -> mods = accel ;
1350
+ g_snprintf (a -> name , sizeof (a -> name ), format_string , replacement );
1351
+ return g_slist_append (actions , a );
1352
+ }
1353
+ else
1354
+ return actions ;
1345
1355
}
1346
1356
1347
1357
static gchar * _mouse_action_get_string (dt_mouse_action_t * ma )
0 commit comments