Skip to content

Commit eb71bc6

Browse files
committed
Nullchecks on report manager endpoints if query is not passed/invalid
1 parent 8efdb4b commit eb71bc6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

api/utils/requestProcessor.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,9 @@ const processRequest = (params) => {
18241824
switch (paths[3]) {
18251825
case 'all':
18261826
validateRead(params, 'core', () => {
1827+
if (!params.qstring.query) {
1828+
params.qstring.query = {};
1829+
}
18271830
if (typeof params.qstring.query === "string") {
18281831
try {
18291832
params.qstring.query = JSON.parse(params.qstring.query);
@@ -1864,6 +1867,9 @@ const processRequest = (params) => {
18641867
break;
18651868
case 'count':
18661869
validateRead(params, 'core', () => {
1870+
if (!params.qstring.query) {
1871+
params.qstring.query = {};
1872+
}
18671873
if (typeof params.qstring.query === "string") {
18681874
try {
18691875
params.qstring.query = JSON.parse(params.qstring.query);
@@ -1896,6 +1902,9 @@ const processRequest = (params) => {
18961902
break;
18971903
case 'list':
18981904
validateRead(params, 'core', () => {
1905+
if (!params.qstring.query) {
1906+
params.qstring.query = {};
1907+
}
18991908
if (typeof params.qstring.query === "string") {
19001909
try {
19011910
params.qstring.query = JSON.parse(params.qstring.query);

0 commit comments

Comments
 (0)