Reported-by: Luiz Capitulino <lcapitul...@redhat.com>
Signed-off-by: Anthony Liguori <aligu...@us.ibm.com>
---
 error.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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': '");
-- 
1.7.4.1


Reply via email to