diff options
Diffstat (limited to 'gnu/lib/libobjc/libobjc/Protocol.m')
-rw-r--r-- | gnu/lib/libobjc/libobjc/Protocol.m | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gnu/lib/libobjc/libobjc/Protocol.m b/gnu/lib/libobjc/libobjc/Protocol.m index 3c18a02ce97..ab41bfe2ce7 100644 --- a/gnu/lib/libobjc/libobjc/Protocol.m +++ b/gnu/lib/libobjc/libobjc/Protocol.m @@ -80,11 +80,12 @@ struct objc_method_description_list { const char* name = sel_get_name (aSel); struct objc_method_description *result; - for (i = 0; i < instance_methods->count; i++) - { - if (!strcmp ((char*)instance_methods->list[i].name, name)) - return &(instance_methods->list[i]); - } + if (instance_methods) + for (i = 0; i < instance_methods->count; i++) + { + if (!strcmp ((char*)instance_methods->list[i].name, name)) + return &(instance_methods->list[i]); + } for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) { @@ -107,11 +108,12 @@ struct objc_method_description_list { const char* name = sel_get_name (aSel); struct objc_method_description *result; - for (i = 0; i < class_methods->count; i++) - { - if (!strcmp ((char*)class_methods->list[i].name, name)) - return &(class_methods->list[i]); - } + if (class_methods) + for (i = 0; i < class_methods->count; i++) + { + if (!strcmp ((char*)class_methods->list[i].name, name)) + return &(class_methods->list[i]); + } for (proto_list = protocol_list; proto_list; proto_list = proto_list->next) { |