Prevent trying to update items that are not in the database

This commit is contained in:
Paul van Tilburg 2012-02-14 23:48:19 +01:00
parent 0a29a078f6
commit b05d59b318
1 changed files with 4 additions and 0 deletions

4
app.js
View File

@ -330,6 +330,10 @@ app.get('/draggables/:id', function(req, res) {
// i.e. the global state.
app.post('/draggables/:id', function(req, res) {
var drag = draggables[req.params.id];
if (!drag) {
res.send(false);
return;
}
if (req.body.title) {
// It's a title update!
console.log("Title update for draggable " + req.params.id + ": " +