Fixes java.lang.NullPointerException in combination with call to onWebRtcAudioTrackInitError()

BUG=NONE

Change-Id: I5758a9f7be1dfd50cf34bf31d3aced2d744f5e58
Reviewed-on: https://webrtc-review.googlesource.com/46061
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21805}
diff --git a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
index 3c8c9eb..79b630a 100644
--- a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
+++ b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java
@@ -497,7 +497,7 @@
   private void reportWebRtcAudioTrackInitError(String errorMessage) {
     Logging.e(TAG, "Init playout error: " + errorMessage);
     WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallback != null) {
+    if (errorCallbackOld != null) {
       errorCallbackOld.onWebRtcAudioTrackInitError(errorMessage);
     }
     if (errorCallback != null) {
@@ -509,7 +509,7 @@
       AudioTrackStartErrorCode errorCode, String errorMessage) {
     Logging.e(TAG, "Start playout error: "  + errorCode + ". " + errorMessage);
     WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallback != null) {
+    if (errorCallbackOld != null) {
       errorCallbackOld.onWebRtcAudioTrackStartError(errorMessage);
     }
     if (errorCallback != null) {
@@ -520,7 +520,7 @@
   private void reportWebRtcAudioTrackError(String errorMessage) {
     Logging.e(TAG, "Run-time playback error: " + errorMessage);
     WebRtcAudioUtils.logAudioState(TAG);
-    if (errorCallback != null) {
+    if (errorCallbackOld != null) {
       errorCallbackOld.onWebRtcAudioTrackError(errorMessage);
     }
     if (errorCallback != null) {