diff --git a/lib/vizion.js b/lib/vizion.js index d12c4af..86b38aa 100644 --- a/lib/vizion.js +++ b/lib/vizion.js @@ -45,6 +45,9 @@ vizion.revertTo = function(argv, cb) { var revision = (argv.revision) ? argv.revision : false; var _folder = (argv.folder != undefined) ? argv.folder : '.'; + if (revision && !/^[A-Za-z0-9]+$/.test(revision)) + return cb('Error vizion::revertTo() received an invalid revision: ' + revision); + if (!revision) return cb({msg: 'Cannot revert to an invalid commit revision', path: _folder});