Skip to content

Commit

Permalink
Merge pull request #5651 from Countly/SER-1556
Browse files Browse the repository at this point in the history
[SER-1556] Frontend mix 1. Fix insufficient null checks
  • Loading branch information
ArtursKadikis authored Nov 4, 2024
2 parents b6a1f90 + c3e2f9e commit 8335efd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion api/parts/data/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ fetch.fetchEvents = function(params) {
*/
fetch.fetchTimeObj = function(collection, params, isCustomEvent, options) {
fetchTimeObj(collection, params, isCustomEvent, options, function(output) {
if (params?.qstring?.event) {
if (params.qstring?.event) {
output.eventName = params.qstring.event;
}
common.returnOutput(params, output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@
.then(function(resp) {
if (resp) {
context.commit("setSelectedEventsOverview", countlyAllEvents.helpers.getSelectedEventsOverview(context, resp) || {});
context.commit("setLegendData", countlyAllEvents.helpers.getLegendData(context || {}));
context.commit("setLegendData", countlyAllEvents.helpers.getLegendData(context));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@
return monitorData;
},
getOverviewConfigureList: function(eventsList, groupList) {
var map = eventsList.map || {};
var allEvents = [];
if (eventsList && eventsList.list) {
var map = eventsList.map || {};
eventsList.list.forEach(function(item) {
if (!map[item] || (map[item] && (map[item].is_visible || map[item].is_visible === undefined))) {
var label;
Expand Down Expand Up @@ -141,9 +141,9 @@
return allEvents;
},
getEventMapping: function(eventsList, groupList) {
var map = eventsList.map || {};
var mapping = {};
if (eventsList && eventsList.list) {
var map = eventsList.map || {};
eventsList.list.forEach(function(item) {
var obj = {
"eventKey": item,
Expand Down
4 changes: 2 additions & 2 deletions plugins/alerts/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,10 +992,10 @@


if (newState.alertBy === "email") {
if (newState?.allGroups?.length) {
if (newState.allGroups?.length) {
this.selectedRadioButton = "toGroup";
}
if (newState?.alertValues?.length) {
if (newState.alertValues?.length) {
this.selectedRadioButton = "specificAddress";
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/compare/frontend/public/javascripts/countly.models.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@
return lineLegend;
},
getAllEventsList: function(eventsList, groupList) {
var map = eventsList.map || {};
var allEvents = [];
if (eventsList) {
var map = eventsList.map || {};
eventsList.list.forEach(function(item) {
if (!map[item] || (map[item] && (map[item].is_visible || map[item].is_visible === undefined))) {
var label;
Expand Down Expand Up @@ -245,9 +245,9 @@
return obj;
},
getTableStateMap: function(eventsList, groupList) {
var map = eventsList.map || {};
var allEvents = {};
if (eventsList) {
var map = eventsList.map || {};
eventsList.list.forEach(function(item) {
if (!map[item] || (map[item] && (map[item].is_visible || map[item].is_visible === undefined))) {
allEvents[countlyCompareEvents.helpers.decode(item)] = true;
Expand Down

0 comments on commit 8335efd

Please sign in to comment.