{"record":{"id":"fa2c8ad327171b01","repo":"dianping/cat","slug":"object-keys-called-on-a-non-object-fa2c8a","errorCode":null,"errorMessage":"Object.keys called on a non-object","messagePattern":"Object\\.keys called on a non-object","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/assets/js/uncompressed/x-editable/bootstrap-editable.js","lineNumber":754,"sourceCode":"        getConfigData: function($element) {\n            var data = {};\n            $.each($element.data(), function(k, v) {\n                if(typeof v !== 'object' || (v && typeof v === 'object' && (v.constructor === Object || v.constructor === Array))) {\n                    data[k] = v;\n                }\n            });\n            return data;\n        },\n\n        /*\n         returns keys of object\n        */\n        objectKeys: function(o) {\n            if (Object.keys) {\n                return Object.keys(o);  \n            } else {\n                if (o !== Object(o)) {\n                    throw new TypeError('Object.keys called on a non-object');\n                }\n                var k=[], p;\n                for (p in o) {\n                    if (Object.prototype.hasOwnProperty.call(o,p)) {\n                        k.push(p);\n                    }\n                }\n                return k;\n            }\n\n        },\n        \n       /**\n        method to escape html.\n       **/\n       escape: function(str) {\n           return $('<div>').text(str).html();\n       },","sourceCodeStart":736,"sourceCodeEnd":772,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/uncompressed/x-editable/bootstrap-editable.js#L736-L772","documentation":"Error \"Object.keys called on a non-object\" thrown in dianping/cat.","triggerScenarios":"Triggered when Object.keys is invoked with a null, undefined, or primitive value inside bootstrap-editable option handling.","commonSituations":"See trigger scenarios.","solutions":["Pass a plain object to the API that internally calls Object.keys; check for null or undefined options.","Guard the call with a typeof check before invoking the editable plugin."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}