Skip to content

Commit dc19eac

Browse files
authored
Merge pull request #5845 from Michael77/master
fix "TypeError: Cannot read property 'options' of undefined" error th…
2 parents d5d7c1e + 1ffc38d commit dc19eac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/services/query/castUpdate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function walkUpdatePath(schema, obj, op, strict, context, pref) {
247247
*/
248248

249249
function _handleCastError(error, query, key, aggregatedError) {
250-
if (!query.options.multipleCastError) {
250+
if (typeof query !== 'object' || !query.options.multipleCastError) {
251251
throw error;
252252
}
253253
aggregatedError.addError(key, error);

0 commit comments

Comments
 (0)