From b549e72432f10d596ede827ea2309e251c5c050b Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Wed, 25 Jan 2023 11:44:06 +0000 Subject: [PATCH] assign result of init to self --- Source/GSDictionary.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/GSDictionary.m b/Source/GSDictionary.m index a83ae0f00..344f04c44 100644 --- a/Source/GSDictionary.m +++ b/Source/GSDictionary.m @@ -495,9 +495,11 @@ static SEL objSel; - (id) initWithDictionary: (NSDictionary*)d { - [super init]; - dictionary = (GSDictionary*)RETAIN(d); - enumerator = GSIMapEnumeratorForMap(&dictionary->map); + if (nil != (self = [super init])) + { + dictionary = (GSDictionary*)RETAIN(d); + enumerator = GSIMapEnumeratorForMap(&dictionary->map); + } return self; }