diff --git a/bindings/ruby/ext/ruby_whisper_parakeet_model.c b/bindings/ruby/ext/ruby_whisper_parakeet_model.c index cc43ab917..658ad8b7e 100644 --- a/bindings/ruby/ext/ruby_whisper_parakeet_model.c +++ b/bindings/ruby/ext/ruby_whisper_parakeet_model.c @@ -16,7 +16,7 @@ static void ruby_whisper_parakeet_model_mark(void *p) { ruby_whisper_parakeet_model *rwpm = (ruby_whisper_parakeet_model *)p; - if (rwpm->context) { + if (!NIL_P(rwpm->context)) { rb_gc_mark(rwpm->context); } }