Skip to content

Commit 497b950

Browse files
authored
Merge pull request #3787 from Cookiezaurs/master-bugfix
Preventing crash if array passed as filter to dbviewer.
2 parents d9baffa + 8582bf4 commit 497b950

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

plugins/dbviewer/api/api.js

+3
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ var spawn = require('child_process').spawn,
162162
catch (SyntaxError) {
163163
projection = {};
164164
}
165+
if (typeof filter !== 'object' || Array.isArray(filter)) {
166+
filter = {};
167+
}
165168

166169
if (dbs[dbNameOnParam]) {
167170
var cursor = dbs[dbNameOnParam].collection(params.qstring.collection).find(filter, { projection });

0 commit comments

Comments
 (0)