From 12688aca5f716ac3145b1a9e953354c6d7410a28 Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Thu, 17 Oct 2024 19:02:14 +0100 Subject: [PATCH] fix ArrayIndex constructor --- Objective-C/CBLArrayIndexConfiguration.m | 6 +++--- Objective-C/CBLIndexConfiguration.m | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Objective-C/CBLArrayIndexConfiguration.m b/Objective-C/CBLArrayIndexConfiguration.m index 64538a205..2cac13eb1 100644 --- a/Objective-C/CBLArrayIndexConfiguration.m +++ b/Objective-C/CBLArrayIndexConfiguration.m @@ -33,11 +33,11 @@ - (instancetype) initWithPath: (NSString*) path } else if ([expressions count] == 0 || [expressions[0] length] == 0) { [NSException raise: NSInvalidArgumentException format: @"Empty expressions is not allowed, use nil instead"]; + } else { + self = [super initWithIndexType: kC4ArrayIndex + expressions: expressions]; } - self = [super initWithIndexType: kC4ArrayIndex - expressions: expressions]; - if (self) { _path = path; _expressions = expressions; diff --git a/Objective-C/CBLIndexConfiguration.m b/Objective-C/CBLIndexConfiguration.m index a6c547221..a456757aa 100644 --- a/Objective-C/CBLIndexConfiguration.m +++ b/Objective-C/CBLIndexConfiguration.m @@ -42,7 +42,7 @@ - (instancetype) initWithIndexType: (C4IndexType)type expressions: (NSArray