Fix accidental variable shadowing.

We were looking up the ivar, but then not using the result, so got null
pointer dereferences later.

This should have been caught by normal compiler warnings, but apparently
Gorm turns them off.
This commit is contained in:
David Chisnall 2019-02-03 09:23:14 +00:00
parent 0d3ab06c92
commit 04554d25c8

View file

@ -105,7 +105,7 @@
static Ivar iv;
if (!iv)
{
Ivar iv = class_getInstanceVariable([NSDocument class], "_window");
iv = class_getInstanceVariable([NSDocument class], "_window");
NSAssert(iv, @"Unable to find _window ivar in NSDocument class");
}
return object_getIvar(self, iv);