Skip to content

Commit

Permalink
Prevents #67 - out of bounds color crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Aug 15, 2015
1 parent 782cecb commit 710728b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion SCXcodeMinimap/SCXcodeMinimapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,13 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager
}
}

NSColor *foregroundColor = [[((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType] pointerAtIndex:nodeType];
DVTPointerArray *colors = [((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType];

NSColor *foregroundColor = nil;
if(nodeType < colors.count) {
foregroundColor = [colors pointerAtIndex:nodeType];
}

if(foregroundColor == nil) {
foregroundColor = theme.sourcePlainTextColor;
}
Expand Down

0 comments on commit 710728b

Please sign in to comment.