Skip to content

Commit c02b591

Browse files
committed
fix: gracefully handle missing schema
1 parent 6c9512a commit c02b591

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ DataStore.prototype.find = function ({ query, collection, options = {}, schema,
191191
*/
192192
DataStore.prototype.handshake = function () {
193193
return {
194-
version: '4.2.1'
194+
version: '4.2.2'
195195
}
196196
}
197197

@@ -538,7 +538,7 @@ function getSchemaOrParent (key, schema) {
538538
// use the key as specified or the first part after splitting on '.'
539539
const keyOrParent = (key.split('.').length > 1) ? key.split('.')[0] : key
540540

541-
if (schema[keyOrParent]) {
541+
if (schema && schema[keyOrParent]) {
542542
return schema[keyOrParent]
543543
}
544544
}

0 commit comments

Comments
 (0)