mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Fixed the latest version handler to handle invalid original id inputs.
This commit is contained in:
parent
42c7fca055
commit
3e0394d0d8
1 changed files with 2 additions and 0 deletions
|
@ -298,6 +298,8 @@ module.exports = class Handler
|
|||
|
||||
getLatestVersion: (req, res, original, version) ->
|
||||
# can get latest overall version, latest of a major version, or a specific version
|
||||
return @sendBadInputError(res, 'Invalid MongoDB id: '+original) if not Handler.isID(original)
|
||||
|
||||
query = { 'original': mongoose.Types.ObjectId(original) }
|
||||
if version?
|
||||
version = version.split('.')
|
||||
|
|
Loading…
Reference in a new issue