|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
| 17 | +#include <assert.h> |
| 18 | + |
17 | 19 | #include "app/src/time.h"
|
18 | 20 | #include "auth/src/android/common_android.h"
|
19 | 21 |
|
@@ -286,6 +288,7 @@ void ReadTokenResult(jobject result, FutureCallbackData<std::string>* d,
|
286 | 288 | FIREBASE_ASSERT(result != nullptr);
|
287 | 289 | jstring j_token = static_cast<jstring>(env->CallObjectMethod(
|
288 | 290 | result, tokenresult::GetMethodId(tokenresult::kGetToken)));
|
| 291 | + assert(env->ExceptionCheck() == false); |
289 | 292 | *data = JniStringToString(env, j_token);
|
290 | 293 | } else {
|
291 | 294 | *data = std::string();
|
@@ -323,18 +326,21 @@ const std::vector<UserInfoInterface*>& User::provider_data() const {
|
323 | 326 | // getProviderData returns `List<? extends UserInfo>`
|
324 | 327 | const jobject list = env->CallObjectMethod(
|
325 | 328 | UserImpl(auth_data_), user::GetMethodId(user::kProviderData));
|
| 329 | + assert(env->ExceptionCheck() == false); |
326 | 330 |
|
327 | 331 | // Copy the list into auth_data_->user_infos.
|
328 | 332 | if (list != nullptr) {
|
329 | 333 | const int num_providers =
|
330 | 334 | env->CallIntMethod(list, util::list::GetMethodId(util::list::kSize));
|
| 335 | + assert(env->ExceptionCheck() == false); |
331 | 336 | auth_data_->user_infos.resize(num_providers);
|
332 | 337 |
|
333 | 338 | for (int i = 0; i < num_providers; ++i) {
|
334 | 339 | // user_info is converted to a global reference in
|
335 | 340 | // AndroidWrappedUserInfo() and the local reference is released.
|
336 | 341 | jobject user_info = env->CallObjectMethod(
|
337 | 342 | list, util::list::GetMethodId(util::list::kGet), i);
|
| 343 | + assert(env->ExceptionCheck() == false); |
338 | 344 | auth_data_->user_infos[i] =
|
339 | 345 | new AndroidWrappedUserInfo(auth_data_, user_info);
|
340 | 346 | }
|
@@ -664,8 +670,10 @@ UserMetadata User::metadata() const {
|
664 | 670 | UserMetadata data;
|
665 | 671 | data.last_sign_in_timestamp = env->CallLongMethod(
|
666 | 672 | userMetadata, metadata::GetMethodId(metadata::kGetLastSignInTimestamp));
|
| 673 | + assert(env->ExceptionCheck() == false); |
667 | 674 | data.creation_timestamp = env->CallLongMethod(
|
668 | 675 | userMetadata, metadata::GetMethodId(metadata::kGetCreationTimestamp));
|
| 676 | + assert(env->ExceptionCheck() == false); |
669 | 677 |
|
670 | 678 | env->DeleteLocalRef(userMetadata);
|
671 | 679 |
|
|
0 commit comments