Skip to content

Commit

Permalink
fix(UNT-T30512): Issue #129 Handle division by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-d-simform committed Nov 13, 2024
1 parent fb9bd75 commit b41ce37
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,6 @@ class AudioWaveformModule(context: ReactApplicationContext): ReactContextBaseJav
promise.reject("createOrUpdateExtractor Error" , "No Path Provided")
return
}
if(noOfSamples < 1){
promise.reject("createOrUpdateExtractor Error" , "No Enough Waves Sample Available")
return
}
extractors[playerKey] = WaveformExtractor(
context = reactApplicationContext,
path = path,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Waveform/Waveform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const Waveform = forwardRef<IWaveformRef, IWaveform>((props, ref) => {
const result = await extractWaveformData({
path: path,
playerKey: `PlayerFor${path}`,
noOfSamples: noOfSample,
noOfSamples: Math.max(noOfSample, 1),
});
(onChangeWaveformLoadState as Function)?.(false);

Expand Down

0 comments on commit b41ce37

Please sign in to comment.