File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,10 @@ - (NSMutableArray *) mapHitResultsWithSceneResults: (NSArray<SCNHitTestResult *>
218218
219219
220220
221-
221+ static id ObjectOrNull (id object)
222+ {
223+ return object ?: [NSNull null ];
224+ }
222225
223226- (NSMutableArray *) mapHitResults : (NSArray <ARHitTestResult *> *)results {
224227 NSMutableArray *resultsMapped = [NSMutableArray arrayWithCapacity: [results count ]];
@@ -230,7 +233,7 @@ - (NSMutableArray *) mapHitResults:(NSArray<ARHitTestResult *> *)results {
230233 SCNVector3 position = [self getRelativePositionToOrigin: positionAbsolute];
231234 [resultsMapped addObject: (@{
232235 @" distance" : @(result.distance ),
233- @" id" : result.anchor .identifier .UUIDString ,
236+ @" id" : ObjectOrNull ( result.anchor .identifier .UUIDString ) ,
234237 @" positionAbsolute" : @{
235238 @" x" : @(positionAbsolute.x ),
236239 @" y" : @(positionAbsolute.y ),
You can’t perform that action at this time.
0 commit comments