Authored by Justin R. Miller

refs #264: don't try to add nil annotations

@@ -3130,6 +3130,9 @@ @@ -3130,6 +3130,9 @@
3130 3130
3131 - (void)addAnnotation:(RMAnnotation *)annotation 3131 - (void)addAnnotation:(RMAnnotation *)annotation
3132 { 3132 {
  3133 + if ( ! annotation)
  3134 + return;
  3135 +
3133 @synchronized (_annotations) 3136 @synchronized (_annotations)
3134 { 3137 {
3135 if ([_annotations containsObject:annotation]) 3138 if ([_annotations containsObject:annotation])
@@ -3162,6 +3165,9 @@ @@ -3162,6 +3165,9 @@
3162 3165
3163 - (void)addAnnotations:(NSArray *)newAnnotations 3166 - (void)addAnnotations:(NSArray *)newAnnotations
3164 { 3167 {
  3168 + if ( ! newAnnotations || ! [newAnnotations count])
  3169 + return;
  3170 +
3165 @synchronized (_annotations) 3171 @synchronized (_annotations)
3166 { 3172 {
3167 [_annotations addObjectsFromArray:newAnnotations]; 3173 [_annotations addObjectsFromArray:newAnnotations];