-
Notifications
You must be signed in to change notification settings - Fork 212
Fix issue #190 #274
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
Fix issue #190 #274
Conversation
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.
Also, note that all valid challenge IDs in the platform have the same length, so you should check the number of symbols in ID as well, and reject those with incorrect length.
@@ -56,6 +57,10 @@ class ChallengeDetailPageContainer extends React.Component { | |||
const { challenge, loadChallengeDetails, loadTerms, | |||
openTermsModal, authTokens, challengeId } = this.props; | |||
|
|||
if (isNaN(challengeId)) { |
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.
Please, replace all occurances of isNaN(..)
by _.isNumber(..)
from lodash
; because https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/isNaN (especially, check Confusing special-case behavior
section there)
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.
the result of _.isNumber(NaN)
is true
, I will use _.isNaN()
instead
I found some bug, I'm fixing it. |
No description provided.