Skip to content

Commit b50b1ef

Browse files
committed
Fixed issue #271
1 parent 7b9148b commit b50b1ef

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

geocoding_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.0.1
2+
3+
* Resolved issue #271 where the app could crash if the onError message was null. The error message is now properly handled as nullable.
4+
15
## 4.0.0
26

37
* **BREAKING CHANGES** Please update to Flutter 3.29+ before updating to this version

geocoding_android/android/src/main/java/com/baseflow/geocoding/MethodCallHandlerImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ public void onGeocode(List<Address> addresses) {
129129
}
130130

131131
@Override
132-
public void onError(String errorMessage) {
132+
public void onError(@Nullable String errorMessage) {
133133
result.error(
134134
"IO_ERROR",
135-
String.format(errorMessage),
135+
errorMessage != null ? errorMessage : "Unknown error occurred",
136136
null);
137137
}
138138
});
@@ -163,10 +163,10 @@ public void onGeocode(List<Address> addresses) {
163163
}
164164

165165
@Override
166-
public void onError(String errorMessage) {
166+
public void onError(@Nullable String errorMessage) {
167167
result.error(
168168
"IO_ERROR",
169-
String.format(errorMessage),
169+
errorMessage != null ? errorMessage : "Unknown error occurred",
170170
null);
171171
}
172172
});
@@ -198,10 +198,10 @@ public void onGeocode(List<Address> addresses) {
198198
}
199199

200200
@Override
201-
public void onError(String errorMessage) {
201+
public void onError(@Nullable String errorMessage) {
202202
result.error(
203203
"IO_ERROR",
204-
String.format(errorMessage),
204+
errorMessage != null ? errorMessage : "Unknown error occurred",
205205
null);
206206
}
207207
});

geocoding_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: geocoding_android
22
description: A Flutter Geocoding plugin which provides easy geocoding and reverse-geocoding features.
3-
version: 4.0.0
3+
version: 4.0.1
44
repository: https://github.com/baseflow/flutter-geocoding/tree/main/geocoding_android
55
issue_tracker: https://github.com/Baseflow/flutter-geocoding/issues
66

0 commit comments

Comments
 (0)