Check callback container in GetParakeetParams

This commit is contained in:
Kitaiti Makoto 2026-05-07 01:43:40 +09:00
parent a3515ac9fc
commit f55f3f347c
1 changed files with 15 additions and 0 deletions

View File

@ -132,6 +132,21 @@ typedef struct {
#define GetParakeetParams(obj, rwpp) do { \
TypedData_Get_Struct((obj), ruby_whisper_parakeet_params, &ruby_whisper_parakeet_params_type, (rwpp)); \
if (!(rwpp)->new_segment_callback_container) { \
rb_raise(rb_eRuntimeError, "Not initialized"); \
} \
if (!(rwpp)->new_token_callback_container) { \
rb_raise(rb_eRuntimeError, "Not initialized"); \
} \
if (!(rwpp)->progress_callback_container) { \
rb_raise(rb_eRuntimeError, "Not initialized"); \
} \
if (!(rwpp)->encoder_begin_callback_container) { \
rb_raise(rb_eRuntimeError, "Not initialized"); \
} \
if (!(rwpp)->abort_callback_container) { \
rb_raise(rb_eRuntimeError, "Not initialized"); \
} \
} while (0)
#endif