Don't crash when trying to synchronize on nil (but don't do anything sensible either).

This commit is contained in:
theraven 2013-07-18 09:14:02 +00:00
parent 8979f19f1d
commit d838f7ad28

View File

@ -361,7 +361,7 @@ PRIVATE void gc_setTypeForClass(Class cls, void *type)
int objc_sync_enter(id object)
{
if (isSmallObject(object)) { return 0; }
if ((object == 0) || isSmallObject(object)) { return 0; }
struct reference_list *list = referenceListForObject(object, YES);
LOCK(&list->lock);
return 0;
@ -369,7 +369,7 @@ int objc_sync_enter(id object)
int objc_sync_exit(id object)
{
if (isSmallObject(object)) { return 0; }
if ((object == 0) || isSmallObject(object)) { return 0; }
struct reference_list *list = referenceListForObject(object, NO);
if (NULL != list)
{