Skip to content

Commit 6938b70

Browse files
committed
fix record audio crash issue.
1 parent 3842bc9 commit 6938b70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chat/src/main/java/cn/wildfire/chat/kit/audio/AudioRecorderPanel.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ private void startRecord() {
115115
if (recorder == null) {
116116
recorder = new AudioRecorder(context);
117117
handler = new Handler();
118+
} else {
119+
handler.removeCallbacks(this::hideRecording);
118120
}
119121
currentAudioFile = genAudioFile();
120122
recorder.startRecord(currentAudioFile);
@@ -188,6 +190,9 @@ private void showRecording() {
188190
}
189191

190192
private void hideRecording() {
193+
if (recordingWindow == null) {
194+
return;
195+
}
191196
recordingWindow.dismiss();
192197
recordingWindow = null;
193198
}

0 commit comments

Comments
 (0)