Przeglądaj źródła

Fix bug in potentiallyUnwrapBoxedPointer:

Tanner Bennett 6 lat temu
rodzic
commit
492d2e49fe
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      Classes/Utility/FLEXRuntimeUtility.m

+ 5 - 0
Classes/Utility/FLEXRuntimeUtility.m

@@ -65,6 +65,11 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
     // we check to see if the pointer is of a valid object. If not,
     // we just display the NSValue.
     if (!returnsObjectOrClass) {
+        // Skip NSNumber instances
+        if ([returnedObjectOrNil isKindOfClass:[NSNumber class]]) {
+            return returnedObjectOrNil;
+        }
+        
         // Can only be NSValue since return type is not an object,
         // so we bail if this doesn't add up
         if (![returnedObjectOrNil isKindOfClass:[NSValue class]]) {