-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
Easy1-5 Hours1-5 Hours
Description
cve-services/src/controller/org.controller/org.controller.js
Lines 451 to 453 in 69b2859
| if (!body?.username || typeof body?.username !== 'string' || !body?.username.length > 0) { | |
| return res.status(400).json({ message: 'Parameters were invalid', details: [{ param: 'username', msg: 'Parameter must be a non empty string' }] }) | |
| } |
body?.username already checks for a nonzero length because "" is falsy.
!body?.username.length > 0 means to convert a zero length to true and convert any other length to false, and then compare that boolean to zero. Because this code is reached only when the length is nonzero,
|| !body?.username.length > 0
is always equivalent to:
|| false
and can be omitted.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Easy1-5 Hours1-5 Hours
Type
Projects
Status
In Review