]> git.saurik.com Git - cycript.git/blobdiff - Library.mm
Fixed a stupid set of bugs that broke HelloCycript: first a NULL dereference in sig...
[cycript.git] / Library.mm
index 9cb0060e14d0b3db5dd55c37fcf7694c375f16bf..252f9a40b84093cbef107e494e9f5d43b3bd3350 100644 (file)
@@ -2016,8 +2016,10 @@ MSHook(void, objc_registerClassPair, Class _class) {
 
 static JSValueRef objc_registerClassPair_(JSContextRef context, JSObjectRef object, JSObjectRef _this, size_t count, const JSValueRef arguments[], JSValueRef *exception) {
     CYTry {
+        if (count != 1)
+            @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"incorrect number of arguments to objc_registerClassPair" userInfo:nil];
         CYPool pool;
-        Class _class(CYCastNSObject(pool, context, object));
+        Class _class(CYCastNSObject(pool, context, arguments[0]));
         $objc_registerClassPair(_class);
         return CYJSUndefined(context);
     } CYCatch