fix a bug where converting a NULL pointer as an opaque type value to Ruby would not give nil (as in RubyCocoa)
--- MacRuby/trunk/compiler.cpp 2011-03-14 18:50:42 UTC (rev 5277)
+++ MacRuby/trunk/compiler.cpp 2011-03-15 02:03:16 UTC (rev 5278)
@@ -5749,6 +5749,9 @@
VALUE
rb_vm_new_opaque(VALUE klass, void *val)
{
+ if (val == NULL) {
+ return Qnil;
+ }
return Data_Wrap_Struct(klass, NULL, NULL, val);
}