check if new value is undefined

This commit is contained in:
Jakob Ketterl 2021-01-13 23:50:36 +01:00
parent db98590985
commit 7f3071336b

View File

@ -236,7 +236,7 @@ Demodulator.prototype.emit = function(event, params) {
}; };
Demodulator.prototype.set_offset_frequency = function(to_what) { Demodulator.prototype.set_offset_frequency = function(to_what) {
if (to_what > bandwidth / 2 || to_what < -bandwidth / 2) return; if (typeof(to_what) == 'undefined' || to_what > bandwidth / 2 || to_what < -bandwidth / 2) return;
to_what = Math.round(to_what); to_what = Math.round(to_what);
if (this.offset_frequency === to_what) { if (this.offset_frequency === to_what) {
return; return;