From b98ecf79612efe4753c885670bad1a16c75c79c0 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 12 Sep 2011 21:28:30 +0000 Subject: - Improve time zone checking to account for NULL timezones, which should address Issue #1181 --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 0e96ce5d..19de4ddb 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -3276,7 +3276,7 @@ void pingThreadCleanup(void *pingDetails) * Retrieve connection variables and use them to update local variables - incuding * server version string, server time zone, and the current connection encoding. */ -- (void)_updateConnectionVariables; +- (void)_updateConnectionVariables { if (!mConnected) return; @@ -3301,7 +3301,7 @@ void pingThreadCleanup(void *pingDetails) // Get the timezone NSString *serverTimeZoneName = nil; NSTimeZone *serverTimeZone = nil; - if ([variables objectForKey:@"time_zone"]) { + if ([variables objectForKey:@"time_zone"] && ![[variables objectForKey:@"time_zone"] isNSNull]) { if ([[variables objectForKey:@"time_zone"] isEqualToString:@"SYSTEM"]) { if ([variables objectForKey:@"system_time_zone"]) { serverTimeZoneName = [variables objectForKey:@"system_time_zone"]; @@ -3309,7 +3309,7 @@ void pingThreadCleanup(void *pingDetails) } else { serverTimeZoneName = [variables objectForKey:@"time_zone"]; } - } else if ([variables objectForKey:@"timezone"]) { + } else if ([variables objectForKey:@"timezone"] && ![[variables objectForKey:@"timezone"] isNSNull]) { serverTimeZoneName = [variables objectForKey:@"timezone"]; } if (!serverTimeZoneName) { -- cgit v1.2.3