Merge pull request #296 from jhollinger/api_fix
Bugfix to API calling indexOf on an undefined padID
This commit is contained in:
commit
d73f053b5a
|
@ -293,7 +293,7 @@ Example returns:
|
||||||
exports.createPad = function(padID, text, callback)
|
exports.createPad = function(padID, text, callback)
|
||||||
{
|
{
|
||||||
//ensure there is no $ in the padID
|
//ensure there is no $ in the padID
|
||||||
if(padID.indexOf("$") != -1)
|
if(padID && padID.indexOf("$") != -1)
|
||||||
{
|
{
|
||||||
callback(new customError("createPad can't create group pads","apierror"));
|
callback(new customError("createPad can't create group pads","apierror"));
|
||||||
return;
|
return;
|
||||||
|
@ -360,7 +360,7 @@ Example returns:
|
||||||
exports.setPublicStatus = function(padID, publicStatus, callback)
|
exports.setPublicStatus = function(padID, publicStatus, callback)
|
||||||
{
|
{
|
||||||
//ensure this is a group pad
|
//ensure this is a group pad
|
||||||
if(padID.indexOf("$") == -1)
|
if(padID && padID.indexOf("$") == -1)
|
||||||
{
|
{
|
||||||
callback(new customError("You can only get/set the publicStatus of pads that belong to a group","apierror"));
|
callback(new customError("You can only get/set the publicStatus of pads that belong to a group","apierror"));
|
||||||
return;
|
return;
|
||||||
|
@ -393,7 +393,7 @@ Example returns:
|
||||||
exports.getPublicStatus = function(padID, callback)
|
exports.getPublicStatus = function(padID, callback)
|
||||||
{
|
{
|
||||||
//ensure this is a group pad
|
//ensure this is a group pad
|
||||||
if(padID.indexOf("$") == -1)
|
if(padID && padID.indexOf("$") == -1)
|
||||||
{
|
{
|
||||||
callback(new customError("You can only get/set the publicStatus of pads that belong to a group","apierror"));
|
callback(new customError("You can only get/set the publicStatus of pads that belong to a group","apierror"));
|
||||||
return;
|
return;
|
||||||
|
@ -419,7 +419,7 @@ Example returns:
|
||||||
exports.setPassword = function(padID, password, callback)
|
exports.setPassword = function(padID, password, callback)
|
||||||
{
|
{
|
||||||
//ensure this is a group pad
|
//ensure this is a group pad
|
||||||
if(padID.indexOf("$") == -1)
|
if(padID && padID.indexOf("$") == -1)
|
||||||
{
|
{
|
||||||
callback(new customError("You can only get/set the password of pads that belong to a group","apierror"));
|
callback(new customError("You can only get/set the password of pads that belong to a group","apierror"));
|
||||||
return;
|
return;
|
||||||
|
@ -448,7 +448,7 @@ Example returns:
|
||||||
exports.isPasswordProtected = function(padID, callback)
|
exports.isPasswordProtected = function(padID, callback)
|
||||||
{
|
{
|
||||||
//ensure this is a group pad
|
//ensure this is a group pad
|
||||||
if(padID.indexOf("$") == -1)
|
if(padID && padID.indexOf("$") == -1)
|
||||||
{
|
{
|
||||||
callback(new customError("You can only get/set the password of pads that belong to a group","apierror"));
|
callback(new customError("You can only get/set the password of pads that belong to a group","apierror"));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue