Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[media-library] Fix getAssetsAsync crash when given invalid after value on Android #9466

Merged
merged 3 commits into from Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/expo-media-library/CHANGELOG.md
Expand Up @@ -10,6 +10,8 @@

### 🐛 Bug fixes

- Fixed `getAssetsAsync` crashes when given invalid `after` value on Android. ([#9466](https://github.com/expo/expo/pull/9466) by [@barthap](https://github.com/barthap))

## 8.4.0 — 2020-07-27

### 🐛 Bug fixes
Expand Down
Expand Up @@ -87,8 +87,12 @@ public GetQueryInfo invoke() {
}

// to maintain compatibility with IOS field after is in string object
mOffset = mInput.containsKey("after") ?
try {
mOffset = mInput.containsKey("after") ?
Integer.parseInt((String) mInput.get("after")) : 0;
} catch (NumberFormatException e) {
mOffset = 0;
}
return this;
}
}