Skip to content

Commit

Permalink
Merge pull request #109 from rodrigograca31/patch-3
Browse files Browse the repository at this point in the history
kludge to fix null pointer on low memory devices
  • Loading branch information
vstirbu authored Mar 29, 2019
2 parents 492da6a + d64bc70 commit 3620b63
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.5.8 / 2019-03-29

* fix for low memory devices

# 0.5.7 / 2018-05-29

* fixed support for Android 8
* fixed support for Android 8
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-instagram-plugin",
"version": "0.5.7",
"version": "0.5.8",
"description": "Share the content of a canvas element or a dataUrl encoded image using the Instagram application for iOS and Android.",
"cordova": {
"id": "cordova-instagram-plugin",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-instagram-plugin"
version="0.5.7">
version="0.5.8">

<name>Instagram</name>

Expand Down
8 changes: 6 additions & 2 deletions src/android/CDVInstagramPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,14 @@ private void share(String imageString, String captionString) {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == Activity.RESULT_OK) {
Log.v("Instagram", "shared ok");
this.cbContext.success();
if(this.cbContext != null) {
this.cbContext.success();
}
} else if (resultCode == Activity.RESULT_CANCELED) {
Log.v("Instagram", "share cancelled");
this.cbContext.error("Share Cancelled");
if(this.cbContext != null) {
this.cbContext.error("Share Cancelled");
}
}
}
}

0 comments on commit 3620b63

Please sign in to comment.