Skip to content

2 crash fixes #24

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ImageCapInset.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ImageCapInset extends Component {

ImageCapInset.propTypes = {
...View.propTypes,
source: Image.propTypes.source,
source: PropTypes.source,
capInsets: PropTypes.shape({
top: PropTypes.number,
left: PropTypes.number,
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ android {
}

dependencies {
compile 'com.facebook.react:react-native:+'
}
implementation 'com.facebook.react:react-native:+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public void reload() {
RCTImageLoaderTask task = new RCTImageLoaderTask(mUri, getContext(), new RCTImageLoaderListener() {
@Override
public void onImageLoaded(Bitmap bitmap) {
if (bitmap == null) {
return;
}

int ratio = Math.round(bitmap.getDensity() / 160);
int top = mCapInsets.top * ratio;
int right = bitmap.getWidth() - (mCapInsets.right * ratio);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public RCTImageLoaderTask(String uri, Context context, RCTImageLoaderListener li

@Override
protected Bitmap doInBackground(String... params) {
if (mUri.startsWith("http")) {
if (mUri != null && mUri.startsWith("http")) {
return loadBitmapByExternalURL(mUri);
}

Expand Down