*/
GList *bookmark_get_by_tags(const char *tags)
{
- GList *res = NULL;
- GList *src = load(vb.files[FILES_BOOKMARK]);
+ GList *res = NULL, *src = NULL;
char **parts;
unsigned int len;
+ if (!tags) {
+ return NULL;
+ }
+
+ src = load(vb.files[FILES_BOOKMARK]);
parts = g_strsplit(tags, " ", 0);
len = g_strv_length(parts);
vb_set_mode(VB_MODE_NORMAL, false);
- if ((key = strchr(arg->s, '='))) {
+ if (arg->s && (key = strchr(arg->s, '='))) {
*key = '\0';
if (arg->s) {
return keybind_add_from_string(arg->s, key + 1, arg->i);