Skip to content

Commit

Permalink
Merge pull request #5601 from Countly/anna/master
Browse files Browse the repository at this point in the history
Nullchecks on report manager endpoints if query is not passed/invalid
  • Loading branch information
Cookiezaurs authored Sep 25, 2024
2 parents 587806f + fb8c53a commit f35e4f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/utils/requestProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,9 @@ const processRequest = (params) => {
switch (paths[3]) {
case 'all':
validateRead(params, 'core', () => {
if (!params.qstring.query) {
params.qstring.query = {};
}
if (typeof params.qstring.query === "string") {
try {
params.qstring.query = JSON.parse(params.qstring.query);
Expand Down Expand Up @@ -1864,6 +1867,9 @@ const processRequest = (params) => {
break;
case 'count':
validateRead(params, 'core', () => {
if (!params.qstring.query) {
params.qstring.query = {};
}
if (typeof params.qstring.query === "string") {
try {
params.qstring.query = JSON.parse(params.qstring.query);
Expand Down Expand Up @@ -1896,6 +1902,9 @@ const processRequest = (params) => {
break;
case 'list':
validateRead(params, 'core', () => {
if (!params.qstring.query) {
params.qstring.query = {};
}
if (typeof params.qstring.query === "string") {
try {
params.qstring.query = JSON.parse(params.qstring.query);
Expand Down

0 comments on commit f35e4f0

Please sign in to comment.