Patchwork [01/26] error: let error_is_type take a NULL error

login
register
mail settings
Submitter Luiz Capitulino
Date Oct. 5, 2011, 1:21 p.m.
Message ID <1317820931-25872-2-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/117835/
State New
Headers show

Comments

Luiz Capitulino - Oct. 5, 2011, 1:21 p.m.
From: Anthony Liguori <aliguori@us.ibm.com>

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

Patch

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