fix duble error checking

fix whitespace coding convention
This commit is contained in:
aritas1 2012-02-15 15:57:39 +04:00
parent 8bff85cdb2
commit f7d8f68c13
3 changed files with 49 additions and 53 deletions

View file

@ -351,21 +351,21 @@ Pad.prototype.init = function init(text, callback) {
else
{
var firstChangeset = Changeset.makeSplice("\n", 0, 0, exports.cleanText(text));
// if this is a non group pad, add this to the defaultGroup
if(_this.id.indexOf("$")==-1)
{
groupID = "g.defaultGroupName";
groupManager.doesGroupExist(groupID, function(err, exists)
{
if(!exists)
{
db.set("group:" + groupID, {pads: {}});
}
if(!exists)
{
db.set("group:" + groupID, {pads: {}});
}
});
db.setSub("group:"+groupID, ["pads", _this.id], 1);
}
_this.appendRevision(firstChangeset, '');
}