Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'properties' of null #36

Closed
Aerlin opened this issue Oct 28, 2018 · 1 comment
Closed

TypeError: Cannot read property 'properties' of null #36

Aerlin opened this issue Oct 28, 2018 · 1 comment

Comments

@Aerlin
Copy link

Aerlin commented Oct 28, 2018

Latest version introduced a error in a old project of mine.

error: TypeError: Cannot read property 'properties' of null
at Object.keys.forEach.key (/PROJECT_PATH/node_modules/feathers-objection/lib/index.js:202:40)
at Array.forEach ()
at Object.objectify (/PROJECT_PATH/node_modules/feathers-objection/lib/index.js:165:31)
at Object.createQuery (/PROJECT_PATH/node_modules/feathers-objection/lib/index.js:298:10)
at Object._find (/PROJECT_PATH/node_modules/feathers-objection/lib/index.js:316:40)
at Object._get (/PROJECT_PATH/node_modules/feathers-objection/lib/index.js:386:17)
at q.then.row (/PROJECT_PATH/node_modules/feathers-objection/lib/index.js:455:19)
at tryCatcher (/PROJECT_PATH/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/PROJECT_PATH/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/PROJECT_PATH/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/PROJECT_PATH/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/PROJECT_PATH/node_modules/bluebird/js/release/promise.js:693:18)
at Async._drainQueue (/PROJECT_PATH/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/PROJECT_PATH/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/PROJECT_PATH/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)

I found changing line 202 from
const property = this.jsonSchema.properties[column] || methodKey && this.jsonSchema.properties[methodKey];
to
const property = this.jsonSchema && (this.jsonSchema.properties[column] || methodKey && this.jsonSchema.properties[methodKey]);
got rid of the error.

@dekelev
Copy link
Member

dekelev commented Oct 28, 2018

Thank you @Aerlin . Fixed in v1.2.3

@dekelev dekelev closed this as completed Oct 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants