From 1ffc38d457b8bfefce92d250118f7beb6adfe9c0 Mon Sep 17 00:00:00 2001 From: Derek Date: Wed, 22 Nov 2017 11:14:47 -0800 Subject: [PATCH] fix "TypeError: Cannot read property 'options' of undefined" error that stops actual error from being thrown --- lib/services/query/castUpdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/query/castUpdate.js b/lib/services/query/castUpdate.js index 52b11f4f82c..fa519cc1907 100644 --- a/lib/services/query/castUpdate.js +++ b/lib/services/query/castUpdate.js @@ -247,7 +247,7 @@ function walkUpdatePath(schema, obj, op, strict, context, pref) { */ function _handleCastError(error, query, key, aggregatedError) { - if (!query.options.multipleCastError) { + if (typeof query !== 'object' || !query.options.multipleCastError) { throw error; } aggregatedError.addError(key, error);