- mono_nullable_init (addr, mono_value_box (domain, mono_class_from_mono_type (targ), nullable_buf), mono_class_from_mono_type (t));
+ MonoObject *boxed = mono_value_box_checked (domain, mono_class_from_mono_type (targ), nullable_buf, &error);
+ if (!is_ok (&error)) {
+ mono_error_cleanup (&error);
+ return ERR_INVALID_OBJECT;
+ }
+ mono_nullable_init (addr, boxed, mono_class_from_mono_type (t));