mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 00:15:13 -04:00
getPad fails if an invalid padID is passed and only two function arguments
This commit is contained in:
parent
7ede4872b1
commit
96a0c0d0be
1 changed files with 7 additions and 7 deletions
|
@ -54,13 +54,6 @@ var padIdTransforms = [
|
||||||
*/
|
*/
|
||||||
exports.getPad = function(id, text, callback)
|
exports.getPad = function(id, text, callback)
|
||||||
{
|
{
|
||||||
//check if this is a valid padId
|
|
||||||
if(!exports.isValidPadId(id))
|
|
||||||
{
|
|
||||||
callback(new customError(id + " is not a valid padId","apierror"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//make text an optional parameter
|
//make text an optional parameter
|
||||||
if(typeof text == "function")
|
if(typeof text == "function")
|
||||||
{
|
{
|
||||||
|
@ -68,6 +61,13 @@ exports.getPad = function(id, text, callback)
|
||||||
text = null;
|
text = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check if this is a valid padId
|
||||||
|
if(!exports.isValidPadId(id))
|
||||||
|
{
|
||||||
|
callback(new customError(id + " is not a valid padId","apierror"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//check if this is a valid text
|
//check if this is a valid text
|
||||||
if(text != null)
|
if(text != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue