mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-06-30 18:02:15 -04:00
db/API.js, SessionManager: lot of copied & pasted code in integer parsing
Replaced with an early return, no functional changes.
This commit is contained in:
parent
1d45a63864
commit
05a33f1533
2 changed files with 24 additions and 40 deletions
|
@ -90,15 +90,13 @@ exports.createSession = function(groupID, authorID, validUntil, callback)
|
|||
if(typeof validUntil != "number")
|
||||
{
|
||||
//try to parse the number
|
||||
if(!isNaN(parseInt(validUntil)))
|
||||
{
|
||||
validUntil = parseInt(validUntil);
|
||||
}
|
||||
else
|
||||
if(isNaN(parseInt(validUntil)))
|
||||
{
|
||||
callback(new customError("validUntil is not a number","apierror"));
|
||||
return;
|
||||
}
|
||||
|
||||
validUntil = parseInt(validUntil);
|
||||
}
|
||||
|
||||
//ensure this is not a negativ number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue