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>
master
Anthony Liguori 2011-09-02 12:34:44 -05:00 committed by Luiz Capitulino
parent d11cf8cc80
commit acceb4d99f
1 changed files with 4 additions and 0 deletions

View File

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