Skip to content

Commit

Permalink
Merge pull request #633 from Peergos/fix/app-calendar-color-check
Browse files Browse the repository at this point in the history
make sure calendar color is of type string
  • Loading branch information
ianopolous authored Oct 28, 2024
2 parents 229e312 + 2b037e1 commit 349bcad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mixins/sandbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = {
this.$toast.error(this.translate("SANDBOX.UNSAFE") + ': ' + permission, {timeout:false});
}
},
isString: function isString(x) { //https://stackoverflow.com/a/9436948
isString: function(x) { //https://stackoverflow.com/a/9436948
return typeof x === 'string' || x instanceof String;
},
verifyJSONFile: function(file, appPath) {
Expand Down
6 changes: 6 additions & 0 deletions src/views/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,14 @@ module.exports = {
};
this.showPrompt = true;
},
isString: function(x) {
return typeof x === 'string' || x instanceof String;
},
calendarColorChangeRequest: function(calendar, calendarName, newColor) {
let that = this;
if (!this.isString(newColor)) {
return;
}
for (var i=0;i < that.calendarProperties.calendars.length; i++) {
let calendar = that.calendarProperties.calendars[i];
if (calendar.name == calendarName) {
Expand Down

0 comments on commit 349bcad

Please sign in to comment.