Skip to content

Commit

Permalink
fix(maps): Crash when parameters are not strings
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Müller <[email protected]>
  • Loading branch information
SystemKeeper committed Dec 18, 2024
1 parent 991556c commit 629a1d7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions NextcloudTalk/GeoLocationRichObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@ + (instancetype)geoLocationRichObjectFromMessageLocationParameter:(NCMessageLoca
GeoLocationRichObject *richObject = [[self alloc] init];
richObject.objectType = parameter.type;
richObject.objectId = parameter.parameterId;
richObject.latitude = parameter.latitude;
richObject.longitude = parameter.longitude;

if ([parameter.latitude isKindOfClass:[NSNumber class]]) {
richObject.latitude = [(NSNumber *)parameter.latitude stringValue];
} else {
richObject.latitude = parameter.latitude;
}

if ([parameter.longitude isKindOfClass:[NSNumber class]]) {
richObject.longitude = [(NSNumber *)parameter.longitude stringValue];
} else {
richObject.longitude = parameter.longitude;
}

richObject.name = parameter.name;
return richObject;
}
Expand Down

0 comments on commit 629a1d7

Please sign in to comment.