Skip to content

Commit d8324b0

Browse files
committed
Don't crash on no error returned.
1 parent 6ec20f2 commit d8324b0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

ext/libxml/ruby_xml_error.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,12 @@ static VALUE rxml_error_reset_handler(VALUE self)
160160

161161
NORETURN(void rxml_raise(const xmlError *xerror))
162162
{
163-
/* Wrap error up as Ruby object and send it off to ruby */
164-
VALUE error = rxml_error_wrap(xerror);
165-
rb_exc_raise(error);
163+
if (xerror)
164+
{
165+
/* Wrap error up as Ruby object and send it off to ruby */
166+
VALUE error = rxml_error_wrap(xerror);
167+
rb_exc_raise(error);
168+
}
166169
}
167170

168171
void rxml_init_error(void)

0 commit comments

Comments
 (0)