Skip to content

Commit cec87ee

Browse files
author
Marco Romano
authored
Don't crash when sharing a location with no maptiler apikey (#919)
Related to: - element-hq/element-meta#1682
1 parent 8b97d50 commit cec87ee

File tree

1 file changed

+4
-1
lines changed
  • features/location/impl/src/main/kotlin/io/element/android/features/location/impl/send

1 file changed

+4
-1
lines changed

features/location/impl/src/main/kotlin/io/element/android/features/location/impl/send/SendLocationView.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ fun SendLocationView(
133133
)
134134
)
135135
},
136-
modifier = Modifier.clickable {
136+
modifier = Modifier.clickable(
137+
// target is null when the map hasn't loaded (or api key is wrong) so we disable the button
138+
enabled = cameraPositionState.position.target != null
139+
) {
137140
state.eventSink(
138141
SendLocationEvents.SendLocation(
139142
cameraPosition = SendLocationEvents.SendLocation.CameraPosition(

0 commit comments

Comments
 (0)