Permalink
Browse files

Update createContainer to return a correct container when container w…

…as a string in arguments and if container was already an instance of cloudfiles.Container.
  • Loading branch information...
1 parent aa48a77 commit 268bc7626428f8dabbbf33c966f35fbf08050865 @Atinux Atinux committed Feb 1, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/cloudfiles/core.js
View
@@ -194,8 +194,11 @@ Cloudfiles.prototype.createContainer = function (container, callback) {
callback(null, new (cloudfiles.Container)(self, container));
});
}
+ else if (container instanceof cloudfiles.Container) {
+ callback(null, container);
+ }
else {
- callback(null, new (cloudfiles.Container)(self, container));
+ callback(null, new (cloudfiles.Container)(self, { name: containerName }));
}
});
};

0 comments on commit 268bc76

Please sign in to comment.