Guard against crash when dtmf and not ready

Stephen Paul Weber created

Change summary

src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java | 2 
1 file changed, 2 insertions(+)

Detailed changes

src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java 🔗

@@ -717,6 +717,8 @@ public class WebRTCWrapper {
     }
 
     public boolean applyDtmfTone(String tone) {
+        if (localAudioTrack == null || localAudioTrack.rtpSender == null) return false;
+
         localAudioTrack.rtpSender.dtmf().insertDtmf(tone, TONE_DURATION, 100);
         final var handler = new android.os.Handler(android.os.Looper.getMainLooper());
         handler.post(() -> {