Skip to content

Commit

Permalink
Merge pull request #3 from Radweb/catchNullPointer
Browse files Browse the repository at this point in the history
Catch null pointer exception
  • Loading branch information
rmlewisuk authored Jun 28, 2018
2 parents fd02f63 + 931bc02 commit e9ccd28
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.lang.NullPointerException;

public class RNCropImageModule extends ReactContextBaseJavaModule {

Expand Down Expand Up @@ -59,6 +60,8 @@ public void crop(String path, ReadableMap options, Promise promise) {
out.close();
} catch (IOException e) {
promise.reject("Failed to save", "Failed to close saved file stream", null);
} catch (NullPointerException e) {
promise.reject("Failed to save", "Failed to close saved file stream", null);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{
"name": "react-native-crop-image",
"version": "1.2.0",
"version": "1.2.1",
"description": "",
"main": "index.js",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion react-native-crop-image.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "react-native-crop-image"
s.version = "1.2.0"
s.version = "1.2.1"
s.summary = "Crop an image. Super Simple Stuff."
s.description = <<-DESC
Crops an image
Expand Down

0 comments on commit e9ccd28

Please sign in to comment.