diff --git a/completion.c b/completion.c index a3f41a7..872dfba 100644 --- a/completion.c +++ b/completion.c @@ -147,6 +147,10 @@ error_free: girara_completion_t* cc_bookmarks(girara_session_t* session, const char* input) { + if (input == NULL) { + return NULL; + } + g_return_val_if_fail(session != NULL, NULL); g_return_val_if_fail(session->global.data != NULL, NULL); zathura_t* zathura = session->global.data; @@ -158,10 +162,6 @@ cc_bookmarks(girara_session_t* session, const char* input) goto error_free; } - if (!input) { - goto error_free; - } - const size_t input_length = strlen(input); GIRARA_LIST_FOREACH(zathura->bookmarks.bookmarks, zathura_bookmark_t*, iter, bookmark) if (input_length <= strlen(bookmark->id) && !strncmp(input, bookmark->id, input_length)) {