Skip to content

Commit 710728b

Browse files
committed
Prevents #67 - out of bounds color crashes.
1 parent 782cecb commit 710728b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

SCXcodeMinimap/SCXcodeMinimapView.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,13 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager
420420
}
421421
}
422422

423-
NSColor *foregroundColor = [[((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType] pointerAtIndex:nodeType];
423+
DVTPointerArray *colors = [((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType];
424+
425+
NSColor *foregroundColor = nil;
426+
if(nodeType < colors.count) {
427+
foregroundColor = [colors pointerAtIndex:nodeType];
428+
}
429+
424430
if(foregroundColor == nil) {
425431
foregroundColor = theme.sourcePlainTextColor;
426432
}

0 commit comments

Comments
 (0)