mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
db/Pad: reversed condition to make error handling evident. No functional changes
Here it was legal to replace a lax comparison with a strict one, since we are using indexOf(), whose return value is known.
This commit is contained in:
parent
0e8789863c
commit
d931a700b4
1 changed files with 19 additions and 18 deletions
|
@ -476,8 +476,12 @@ Pad.prototype.copy = function copy(destinationID, force, callback) {
|
||||||
// if it's a group pad, let's make sure the group exists.
|
// if it's a group pad, let's make sure the group exists.
|
||||||
function(callback)
|
function(callback)
|
||||||
{
|
{
|
||||||
if (destinationID.indexOf("$") != -1)
|
if (destinationID.indexOf("$") === -1)
|
||||||
{
|
{
|
||||||
|
callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
destGroupID = destinationID.split("$")[0]
|
destGroupID = destinationID.split("$")[0]
|
||||||
groupManager.doesGroupExist(destGroupID, function (err, exists)
|
groupManager.doesGroupExist(destGroupID, function (err, exists)
|
||||||
{
|
{
|
||||||
|
@ -493,9 +497,6 @@ Pad.prototype.copy = function copy(destinationID, force, callback) {
|
||||||
//everything is fine, continue
|
//everything is fine, continue
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
else
|
|
||||||
callback();
|
|
||||||
},
|
},
|
||||||
// if the pad exists, we should abort, unless forced.
|
// if the pad exists, we should abort, unless forced.
|
||||||
function(callback)
|
function(callback)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue