Skip to content

Commit e465f4d

Browse files
v4.3.1: Android: ensure that intent action is not null
- fixes #186
1 parent d7d606c commit e465f4d

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[Release Section](https://github.com/hoxfon/react-native-twilio-programmable-voice/releases)
22

3+
## 4.3.1
4+
5+
- Android: ensure that intent action is not null
6+
37
## 4.3.0
48

59
- iOS add handler to hold/unhold call

android/src/main/java/com/hoxfon/react/RNTwilioVoice/TwilioVoiceModule.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
457457
}
458458

459459
private void handleIncomingCallIntent(Intent intent) {
460-
if (intent.getAction().equals(ACTION_INCOMING_CALL)) {
460+
if (intent == null || intent.getAction() == null) {
461+
return;
462+
}
463+
String action = intent.getAction();
464+
if (action.equals(ACTION_INCOMING_CALL)) {
461465
if (BuildConfig.DEBUG) {
462466
Log.d(TAG, "handleIncomingCallIntent");
463467
}
@@ -488,7 +492,7 @@ private void handleIncomingCallIntent(Intent intent) {
488492
// TODO evaluate what more is needed at this point?
489493
Log.e(TAG, "ACTION_INCOMING_CALL but not active call");
490494
}
491-
} else if (intent.getAction().equals(ACTION_CANCEL_CALL_INVITE)) {
495+
} else if (action.equals(ACTION_CANCEL_CALL_INVITE)) {
492496
SoundPoolManager.getInstance(getReactApplicationContext()).stopRinging();
493497
if (BuildConfig.DEBUG) {
494498
Log.d(TAG, "activeCallInvite was cancelled by " + activeCallInvite.getFrom());
@@ -509,7 +513,7 @@ private void handleIncomingCallIntent(Intent intent) {
509513
}
510514
}
511515
clearIncomingNotification(activeCallInvite.getCallSid());
512-
} else if (intent.getAction().equals(ACTION_FCM_TOKEN)) {
516+
} else if (action.equals(ACTION_FCM_TOKEN)) {
513517
if (BuildConfig.DEBUG) {
514518
Log.d(TAG, "handleIncomingCallIntent ACTION_FCM_TOKEN");
515519
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-twilio-programmable-voice",
3-
"version": "4.3.0",
3+
"version": "4.3.1",
44
"description": "React Native wrapper for Twilio Programmable Voice SDK",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)