Skip to content

Commit b146c93

Browse files
Merge pull request #170 from SimformSolutionsPvtLtd/fix/UNT-T32698-early-out-while-rejecting-promise
fix(UNT-T32698): early out from function while rejecting promise
2 parents 414011f + 544bdaa commit b146c93

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

android/src/main/java/com/audiowaveform/AudioWaveformModule.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ class AudioWaveformModule(context: ReactApplicationContext): ReactContextBaseJav
131131
) {
132132
if(audioPlayers.filter { it.value?.isHoldingAudioTrack() == true }.count() >= MAX_NUMBER_OF_AUDIO_PLAYER) {
133133
promise.reject(Constants.LOG_TAG, "Too many players have been initialized. Please stop some players before continuing")
134+
return
134135
}
135136

136137
val path = obj.getString(Constants.path)

ios/AudioWaveform.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class AudioWaveform: RCTEventEmitter {
115115
let audioUrl = URL.init(string: path!)
116116
if(audioUrl == nil){
117117
reject(Constants.audioWaveforms, "Failed to initialise Url from provided audio file If path contains `file://` try removing it", nil)
118+
return
118119
}
119120
let newExtractor = try WaveformExtractor(url: audioUrl!, channel: self, resolve: resolve, rejecter: reject)
120121
extractors[playerKey] = newExtractor

0 commit comments

Comments
 (0)