Skip to content

Commit

Permalink
SPARK-96421 App Crashed with NullPointerException when Call ended
Browse files Browse the repository at this point in the history
  • Loading branch information
kliu committed Sep 29, 2019
1 parent 20f3379 commit e60e878
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -742,18 +742,21 @@ private void updateMedia() {
return;
}
if (_videoRenderViews != null && _videoRenderViews.first != null && _videoRenderViews.second != null) {
_phone._callControlService.setPreviewWindow(getKey(), _videoRenderViews.first);
_phone._callControlService.setRemoteWindow(getKey(), _videoRenderViews.second);
_phone.getCallService().setPreviewWindow(getKey(), _videoRenderViews.first);
_phone.getCallService().setRemoteWindow(getKey(), _videoRenderViews.second);
} else {
_phone._callControlService.setPreviewWindow(getKey(), null);
_phone._callControlService.removeRemoteVideoWindows(getKey());
_phone.getCallService().setPreviewWindow(getKey(), null);
_phone.getCallService().removeRemoteVideoWindows(getKey());
}

if (_sharingRenderView != null) {
_phone._callControlService.setShareWindow(getKey(), _sharingRenderView);
_phone.getCallService().setShareWindow(getKey(), _sharingRenderView);
} else {
_phone._callControlService.removeShareWindow(getKey());
_phone.getCallService().removeShareWindow(getKey());
}
com.cisco.spark.android.callcontrol.model.Call call = _phone.getCallService().getCall(getKey());
if (call != null) {
_phone.getCallService().updateMediaSession(call, PhoneImpl.mediaOptionToMediaDirection(_option));
}
_phone._callControlService.updateMediaSession(_phone._callControlService.getCall(getKey()), PhoneImpl.mediaOptionToMediaDirection(_option));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,8 @@ public void onEventMainThread(CallControlParticipantJoinedEvent event) {
//group call self join.
com.cisco.spark.android.callcontrol.model.Call locus = _callControlService.getCall(event.getLocusKey());
for (LocusParticipant locusParticipant : event.getJoinedParticipants()) {
if (locusParticipant.getDeviceUrl().equals(_device.getUrl())
&& locus != null
if (locus != null
&& locusParticipant.getDeviceUrl().equals(_device.getUrl())
&& locus.getLocusData().isMeeting()) {
call = new CallImpl(this, _dialOption, CallImpl.Direction.OUTGOING, event.getLocusKey(), locus.getLocusData().isMeeting());
_bus.register(call);
Expand Down Expand Up @@ -1558,7 +1558,10 @@ public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
});
}
}
_callControlService.updateMediaSession(_callControlService.getCall(call.getKey()), mediaOptionToMediaDirection(call.getOption()));
com.cisco.spark.android.callcontrol.model.Call locus = _callControlService.getCall(call.getKey());
if (locus != null) {
_callControlService.updateMediaSession(locus, mediaOptionToMediaDirection(call.getOption()));
}
}
call.setStatus(Call.CallStatus.CONNECTED);

Expand Down

0 comments on commit e60e878

Please sign in to comment.