From acceb4d99fcdabded6ba432402365adb63205196 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Fri, 2 Sep 2011 12:34:44 -0500 Subject: [PATCH] error: let error_is_type take a NULL error Reported-by: Luiz Capitulino Signed-off-by: Anthony Liguori Signed-off-by: Luiz Capitulino --- error.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/error.c b/error.c index b802752..68c0039 100644 --- a/error.c +++ b/error.c @@ -97,6 +97,10 @@ bool error_is_type(Error *err, const char *fmt) char *ptr; char *end; + if (!err) { + return false; + } + ptr = strstr(fmt, "'class': '"); assert(ptr != NULL); ptr += strlen("'class': '"); -- 2.7.4