From 910d3dcf2fcea97d445b94ba902f8a0b8279916e Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 10 Jun 2009 13:14:43 +0000 Subject: =?UTF-8?q?=E2=80=A2=20cleaned=20code=20for=20the=20case=20that=20?= =?UTF-8?q?the=20user=20selects=20a=20view=20which=20causes=20a=20MySQL=20?= =?UTF-8?q?error=20while=20retrieving=20data=20-=20[SPTableData=20tableEnc?= =?UTF-8?q?oding]=20returns=20nil=20if=20no=20encoding=20can=20be=20found?= =?UTF-8?q?=20-=20[TableList=20tableViewSelectionDidChange:]=20checks=20in?= =?UTF-8?q?=20beforehand=20for=20a=20valid=20table=20encoding;=20this=20av?= =?UTF-8?q?oids=20to=20get=20the=20same=20MySQL=20error=20message=20twice?= =?UTF-8?q?=20and=20cleaned=20the=20structure=20view=20=E2=80=A2=20if=20a?= =?UTF-8?q?=20MySQL=20error=20occurred=20while=20retrieving=20table=20data?= =?UTF-8?q?=20for=20the=20content=20view=20set=20the=20content=20view=20to?= =?UTF-8?q?=20a=20defined=20and=20clean=20status=20=E2=80=A2=20bound=20Tab?= =?UTF-8?q?leContent's=20filterButton=20to=20DBView.xib=20to=20disable=20i?= =?UTF-8?q?t=20if=20an=20error=20occurred=20(otherwise=20the=20status=20ba?= =?UTF-8?q?r=20shows=20unexplainable=20results=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableContent.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Source/TableContent.m') diff --git a/Source/TableContent.m b/Source/TableContent.m index 855c44ca..da8a9745 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -110,8 +110,9 @@ [tableContentView removeTableColumn:[theColumns objectAtIndex:0]]; } - // If no table has been supplied, reset the view to a blank table and disabled elements - if ( [aTable isEqualToString:@""] || !aTable ) + // If no table has been supplied, reset the view to a blank table and disabled elements. + // [tableDataInstance tableEncoding] == nil indicates that an error occured while retrieving table data + if ( [aTable isEqualToString:@""] || !aTable || [tableDataInstance tableEncoding] == nil) { // Empty the stored data arrays [fullResult removeAllObjects]; -- cgit v1.2.3