summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 918bad6..df2a250 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -1074,11 +1074,13 @@ loop:
}
if (err == Z_NEED_DICT) {
VALUE self = (VALUE)z->stream.opaque;
- VALUE dicts = rb_ivar_get(self, id_dictionaries);
- VALUE dict = rb_hash_aref(dicts, rb_uint2inum(z->stream.adler));
- if (!NIL_P(dict)) {
- rb_inflate_set_dictionary(self, dict);
- goto loop;
+ if (self) {
+ VALUE dicts = rb_ivar_get(self, id_dictionaries);
+ VALUE dict = rb_hash_aref(dicts, rb_uint2inum(z->stream.adler));
+ if (!NIL_P(dict)) {
+ rb_inflate_set_dictionary(self, dict);
+ goto loop;
+ }
}
}
raise_zlib_error(err, z->stream.msg);