From e349eddd9dccd858f924007ad8a51c4e8da8eef3 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 30 Aug 2011 23:40:13 +0200 Subject: [PATCH] don't fail in :close if nothing is open --- commands.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands.c b/commands.c index bb14888..817165d 100644 --- a/commands.c +++ b/commands.c @@ -28,7 +28,10 @@ cmd_close(girara_session_t* session, girara_list_t* argument_list) g_return_val_if_fail(session != NULL, false); g_return_val_if_fail(session->global.data != NULL, false); zathura_t* zathura = session->global.data; - g_return_val_if_fail(zathura->document != NULL, false); + if (zathura->document == NULL) { + // nothing needs to be done + return true; + } document_close(zathura);