aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-09-02 12:34:44 -0500
committerLuiz Capitulino <lcapitulino@redhat.com>2011-10-04 11:00:46 -0300
commitacceb4d99fcdabded6ba432402365adb63205196 (patch)
tree1447cab6860bfa9e92a15e46c8b05346546a8ac5
parentd11cf8cc80d946dfc9a23597cd9a0bb1c487cfa7 (diff)
error: let error_is_type take a NULL error
Reported-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r--error.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/error.c b/error.c
index b80275261c..68c0039dba 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': '");