Source:
<code>protected void openIntentChooser(ReadableMap options) throws ActivityNotFoundException { if (this.options.hasKey("forceDialog") && this.options.getBoolean("forceDialog")) { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } <START> String socialType = options.getString("social"); <END> if (socialType.equals("instagramstories")) { String method = options.getString("method"); if (method.equals("shareStickerImage") || method.equals("shareBackgroundAndStickerImage")) { activity.grantUriPermission("com.instagram.android", this.stickerAsset.getURI(), Intent.FLAG_GRANT_READ_URI_PERMISSION); } } if (TargetChosenReceiver.isSupported()) { IntentSender sender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, sender); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } else { Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); TargetChosenReceiver.sendCallback(true, true, "OK"); } } else { this.getIntent().setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.reactContext.startActivity(this.getIntent()); TargetChosenReceiver.sendCallback(true, true, this.getIntent().getPackage()); } }</code><technical_language>avoid touching other share objects if checked for null options here, empty-argument openIntentChooser() chained this passing null e.g. java protected void openIntentChooser() throws ActivityNotFoundException { this.openIntentChooser(null); } a minor point</technical_language>

Target:
protected void openIntentChooser(ReadableMap options) throws ActivityNotFoundException { if (this.options.hasKey("forceDialog") && this.options.getBoolean("forceDialog")) { Activity activity = this.reactContext.getCurrentActivity(); if (activity == null) { TargetChosenReceiver.sendCallback(false, "Something went wrong"); return; } if (options != null) { if (ShareIntent.hasValidKey("social", options)) { String socialType = options.getString("social"); if (socialType.equals("instagramstories")) { if (ShareIntent.hasValidKey("method", options)) { String method = options.getString("method"); if (method.equals("shareStickerImage") || method.equals("shareBackgroundAndStickerImage")) { activity.grantUriPermission("com.instagram.android", this.stickerAsset.getURI(), Intent.FLAG_GRANT_READ_URI_PERMISSION); } } else { throw new java.lang.IllegalArgumentException("instagram share mode is empty"); } } } else { throw new java.lang.IllegalArgumentException("social is empty"); } } if (TargetChosenReceiver.isSupported()) { IntentSender sender = TargetChosenReceiver.getSharingSenderIntent(this.reactContext); Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle, sender); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); } else { Intent chooser = Intent.createChooser(this.getIntent(), this.chooserTitle); chooser.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); activity.startActivityForResult(chooser, RNShareModule.SHARE_REQUEST_CODE); TargetChosenReceiver.sendCallback(true, true, "OK"); } } else { this.getIntent().setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); this.reactContext.startActivity(this.getIntent()); TargetChosenReceiver.sendCallback(true, true, this.getIntent().getPackage()); } }