aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructureDelegate.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-03-21 01:31:09 +0000
committerrowanbeentje <rowan@beent.je>2012-03-21 01:31:09 +0000
commit3916b4227d1e02942504e13a2d36b3e6f57670bb (patch)
tree392fc9f3ed09c8cbe5719d04e45303ae2ff190b7 /Source/SPTableStructureDelegate.m
parent566aa46a231fd45a4c373a8122ab2bb6aa39ced6 (diff)
downloadsequelpro-3916b4227d1e02942504e13a2d36b3e6f57670bb.tar.gz
sequelpro-3916b4227d1e02942504e13a2d36b3e6f57670bb.tar.bz2
sequelpro-3916b4227d1e02942504e13a2d36b3e6f57670bb.zip
- Fix a possible race condition exception when switching between tables when th structure view was active, the collation column was visible, and fields had custom collations
Diffstat (limited to 'Source/SPTableStructureDelegate.m')
-rw-r--r--Source/SPTableStructureDelegate.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index 6493e850..d0bbbf75 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -49,7 +49,7 @@
if([[tableColumn identifier] isEqualToString:@"collation"]) {
NSInteger idx = 0;
- if((idx = [[NSArrayObjectAtIndex(tableFields,rowIndex) objectForKey:@"encoding"] integerValue]) > 0) {
+ if((idx = [[NSArrayObjectAtIndex(tableFields,rowIndex) objectForKey:@"encoding"] integerValue]) > 0 && idx < [encodingPopupCell numberOfItems]) {
NSString *enc = [[encodingPopupCell itemAtIndex:idx] title];
NSInteger start = [enc rangeOfString:@"("].location+1;
NSInteger end = [enc length] - start - 1;