Skip to content

Commit d0b9735

Browse files
authored
Merge branch 'next' into ar2rsawseen/next
2 parents d3f4830 + 512e210 commit d0b9735

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

plugins/star-rating/api/api.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ function uploadFile(myfile, id, callback) {
689689
common.db.collection("feedback_widgets").findAndModify({"_id": widgetId }, {}, {$set: changes}, function(err, widget) {
690690
if (!err && widget) {
691691
widget = widget.value;
692-
if (cohortsEnabled && (widget.cohortID && !changes.targeting) || JSON.stringify(changes.targeting) !== JSON.stringify(widget.targeting)) {
692+
if (cohortsEnabled && ((widget.cohortID && !changes.targeting) || JSON.stringify(changes.targeting) !== JSON.stringify(widget.targeting))) {
693693
if (widget.cohortID) {
694694
if (changes.targeting) { //we are not setting to empty one
695695
//changes.targeting.app_id = widget.app_id + "";
@@ -1777,6 +1777,7 @@ function uploadFile(myfile, id, callback) {
17771777
newAtt.cohort_name = "[CLY]_" + type + id;
17781778

17791779
if (!newAtt.user_segmentation || !newAtt.user_segmentation.query) {
1780+
newAtt.user_segmentation = newAtt.user_segmentation || {};
17801781
newAtt.user_segmentation.query = "{}";
17811782
newAtt.user_segmentation.queryText = "{}";
17821783
}

plugins/star-rating/frontend/public/javascripts/countly.models.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
*/
147147
starRatingPlugin.requestFeedbackData = function(filterObj) {
148148
var data = {app_id: countlyCommon.ACTIVE_APP_ID};
149-
if (filterObj.period) {
149+
if (filterObj && filterObj.period) {
150150
if (filterObj.period !== 'noperiod') {
151151
data.period = filterObj.period;
152152
}

0 commit comments

Comments
 (0)