From 6dd9426be95ec99227ece1ac35211e3f19169208 Mon Sep 17 00:00:00 2001 From: CaS Date: Thu, 2 Aug 2001 12:10:46 +0000 Subject: [PATCH] Fix minor bug in returning properties git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10638 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 2 ++ Source/GSHTTPURLHandle.m | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71a10be25..a0e73c797 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * Source/NSPortNameServer.m: Log the host we are connecting to when we produce a warning for a failure of a link to gdomap. + * Source/GSHTTPURLHandle.m: ([-propertyForKeyIfAvailable:]) return + nil if the property is not available. 2001-08-01 Richard Frith-Macdonald diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index ff2941276..d226fa8cf 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -591,7 +591,11 @@ static NSLock *urlLock = nil; NSString *key = [propertyKey lowercaseString]; NSArray *array = [document headersNamed: key]; - if ([array count] == 1) + if ([array count] == 0) + { + return nil; + } + else if ([array count] == 1) { result = [[array objectAtIndex: 0] objectForKey: @"BaseValue"]; }