Skip to content

Commit 0836fbb

Browse files
committed
add console warnings on problem
1 parent 3e8b96f commit 0836fbb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/library/core.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ export class Waveform {
178178

179179
if (peaksLength === 0) {
180180
// nothing to draw
181+
console.warn('can not draw, peaks array (waveData) is empty');
182+
return;
183+
}
184+
185+
if (range < 0 || range > 100) {
186+
console.warn('range value must be >= 0 and <= 100');
181187
return;
182188
}
183189

0 commit comments

Comments
 (0)