{"action":"closed","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/4162","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/4162/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4162/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/4162/events","html_url":"https://github.com/sequelize/sequelize/issues/4162","id":96212424,"number":4162,"title":"Save function no work in version 3.4.1.","user":{"login":"sinpaout","id":10008699,"avatar_url":"https://avatars.githubusercontent.com/u/10008699?v=3","gravatar_id":"","url":"https://api.github.com/users/sinpaout","html_url":"https://github.com/sinpaout","followers_url":"https://api.github.com/users/sinpaout/followers","following_url":"https://api.github.com/users/sinpaout/following{/other_user}","gists_url":"https://api.github.com/users/sinpaout/gists{/gist_id}","starred_url":"https://api.github.com/users/sinpaout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sinpaout/subscriptions","organizations_url":"https://api.github.com/users/sinpaout/orgs","repos_url":"https://api.github.com/users/sinpaout/repos","events_url":"https://api.github.com/users/sinpaout/events{/privacy}","received_events_url":"https://api.github.com/users/sinpaout/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-21T02:46:23Z","updated_at":"2015-07-21T06:00:07Z","closed_at":"2015-07-21T06:00:07Z","body":"I've updated to sequelize@3.4.1 at this morning.\r\nThen my test fail with below error. I am testing with sqlite db.\r\n\r\nhere is error\r\n```\r\nD:\\apps\\node\\graphed>node db/db.js\r\nUnhandled rejection TypeError: Object.keys called on non-object\r\n    at Function.keys (native)\r\n    at null.<anonymous> (D:\\apps\\node\\graphed\\node_modules\\sequelize\\lib\\instance.js:639:56)\r\n    at tryCatcher (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\util.js:26:23)\r\n    at Promise._settlePromiseFromHandler (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\promise.js:503:31)\r\n    at Promise._settlePromiseAt (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\promise.js:577:18)\r\n    at Promise._settlePromises (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\promise.js:693:14)\r\n    at Async._drainQueue (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\async.js:123:16)\r\n    at Async._drainQueues (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\async.js:133:10)\r\n    at Async.drainQueues (D:\\apps\\node\\graphed\\node_modules\\bluebird\\js\\main\\async.js:15:14)\r\n    at process._tickCallback (node.js:419:13)\r\n```\r\n\r\nhere is test code\r\n\r\n``` javascript\r\nvar path = require('path');\r\nvar _s = require('underscore.string');\r\nvar APP_DIR = _s.trim(process.env.APP_DIR || __dirname);\r\nvar Models = require(path.join(APP_DIR, './models'))({env: 'test'});\r\nvar User = Models.User;\r\n\r\nUser.create({\r\n    userName: 'bbbb'\r\n}).then(function(newRow) {\r\n\r\n    User.find({\r\n        userName: 'bbbb'\r\n    }).then(function(foundUser) {\r\n        foundUser.userName = 'cccc';\r\n\r\n        foundUser.save().then(function() {\r\n            console.log('saved');\r\n        });\r\n    });\r\n});\r\n```\r\n\r\nhere is model\r\n``` javascript\r\nmodule.exports = function(sequelize, DataTypes) {\r\n    return sequelize.define('User', {\r\n        id: {\r\n            autoIncrement: true,\r\n            type: DataTypes.INTEGER,\r\n            field: 'rowid'\r\n        },\r\n        userName: {\r\n            type: DataTypes.STRING,\r\n            field: 'name'\r\n        }\r\n    }, {\r\n        freezeTableName: true,\r\n        tableName: 'users',\r\n        timestamps: false\r\n    });\r\n};\r\n```\r\n\r\nI've debug into `instance.js` and found that `Object.keys` function failed because `where` object is null.\r\n[problem code][1].\r\n\r\n  [1]: \r\nhttps://github.com/sequelize/sequelize/blob/f678009d7514b81a6f87e12b86360e9a597e3ca8/lib/instance.js#L639"}}