mono/monomac — pull request #79 by mauricio (2012-09-27 21:28:54+00:00)
Title: Raise an exception if the superclass you're trying to find is not registered yet

Found this issue while running some specific tests of our test suite. In the case you didn't call `NSApplication.Init()` or didn't register the types yourself at `MonoMac.ObjCRuntime` the `Lookup` method enters an eternal loop because `kls` is always `IntPtr.Zero` and calling `class_getSuperclass` with `IntPtr.Zero` also returns zero.

Since the code is a `while(true)` it never goes out of the loop and the thread is stuck forever. This PR makes it raise an exception if it reaches this case instead of being locked forever.