1602 / 1602/jugglingdb

Incorrect behaviour with "undefined" query parameter.

Aperta
#220 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2k
Fork
238
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Controller Coffeescript:

User.findOne {where: { confirmation_token: token }}, (err, user) -> ...

if token variable is undefined then I get the following error:

500 TypeError: Cannot read property 'constructor' of undefined

And there are no any reference to the controller which throws above error

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Look at the User.findOne method in the ORM's codebase, likely in a model or adapter file. The error suggests the token parameter is undefined when passed to a database query. Start by finding where confirmation_token is processed and add a guard to check for undefined. Run the controller test suite to verify the fix handles undefined without a 500 error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
coffeescript, javascript, nodejs
Ambito
backend, databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.