diff --git a/packages/google_sign_in/CHANGELOG.md b/packages/google_sign_in/CHANGELOG.md index 8dcaa3a61f55..13aafeea58af 100644 --- a/packages/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.6 + +* Fixed the `PlatformException` leaking from `catchError()` in debug mode. + ## 4.0.5 * Update README with solution to `APIException` errors. @@ -6,7 +10,7 @@ * Revert changes in 4.0.3. -## 4.0.3 +## 4.0.3 * Update guava to `27.0.1-android`. * Add correct @NonNull annotations to reduce compiler warnings. diff --git a/packages/google_sign_in/lib/google_sign_in.dart b/packages/google_sign_in/lib/google_sign_in.dart index 740188fd8767..ca6e6bbaf705 100755 --- a/packages/google_sign_in/lib/google_sign_in.dart +++ b/packages/google_sign_in/lib/google_sign_in.dart @@ -342,9 +342,13 @@ class _MethodCompleter { final Completer _completer = Completer(); - void complete(FutureOr value) { + Future complete(FutureOr value) async { if (value is Future) { - value.then(_completer.complete, onError: _completer.completeError); + try { + _completer.complete(await value); + } catch (e, stacktrace) { + _completer.completeError(e, stacktrace); + } } else { _completer.complete(value); } diff --git a/packages/google_sign_in/pubspec.yaml b/packages/google_sign_in/pubspec.yaml index d337bd1fc9e9..ee5ad7e3f861 100755 --- a/packages/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android and iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in -version: 4.0.5 +version: 4.0.6 flutter: plugin: