New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MBS-11114: Allow track times to be unset #1712
Conversation
@@ -159,7 +159,7 @@ class Track { | |||
|
|||
var newLength = utils.unformatTrackLength(length); | |||
|
|||
if (!newLength) { | |||
if (Number.isNaN(newLength)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This previously used https://lodash.com/docs/4.17.15#isNaN which is based on Number.isNaN
, not isNaN
:
Note: This method is based on Number.isNaN and is not the same as global isNaN which returns true for undefined and other non-number values.
0d45452 broke this by incorrectly removing the "useless" isNaN check, which it turns out was not "useless." The result of `unformatTrackLength` is null when the length is empty, so the bug is that we'd bail out too early with the new check and fail to set `this.length(newLength)`. The result is only NaN when the input can't be parsed. A test is now added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0d45452 broke this by incorrectly removing the "useless" isNaN check, which it turns out was not "useless." The result of `unformatTrackLength` is null when the length is empty, so the bug is that we'd bail out too early with the new check and fail to set `this.length(newLength)`. The result is only NaN when the input can't be parsed. A test is now added.
0d45452 broke this by incorrectly removing the "useless" isNaN check, which it turns out was not "useless." The result of
unformatTrackLength
is null when the length is empty, so the bug is that we'd bail out too early with the new check and fail to setthis.length(newLength)
. The result is only NaN when the input can't be parsed. A test is now added.