[macos] Check for implementation before calling -toolTip

Also fixed a couple typos in changelogs.
This commit is contained in:
Minh Nguyễn
2017-01-16 21:50:08 -08:00
committed by Minh Nguyễn
parent 13b97dd0ce
commit 2dae2254dd
3 changed files with 6 additions and 5 deletions

View File

@@ -1820,7 +1820,7 @@ public:
}
// Opt into potentially expensive tooltip tracking areas.
if (annotation.toolTip.length) {
if ([annotation respondsToSelector:@selector(toolTip)] && annotation.toolTip.length) {
_wantsToolTipRects = YES;
}
}
@@ -2355,7 +2355,7 @@ public:
for (MGLAnnotationTag annotationTag : annotationTags) {
MGLAnnotationImage *annotationImage = [self imageOfAnnotationWithTag:annotationTag];
id <MGLAnnotation> annotation = [self annotationWithTag:annotationTag];
if (annotation.toolTip.length) {
if ([annotation respondsToSelector:@selector(toolTip)] && annotation.toolTip.length) {
// Add a tooltip tracking area over the annotation image’s
// frame, accounting for the image’s alignment rect.
NSImage *image = annotationImage.image;