bugfix PreventInvitation; fix object parsing on a blank user

pull/56/head
Alexandre Cloutier 2014-09-09 15:34:04 -04:00
parent f3ca4ea7fc
commit 574c245758
1 changed files with 2 additions and 2 deletions

View File

@ -237,15 +237,15 @@ function initPreferences() {
var whiteList = $("appointmentsWhiteListWrapper");
if (whiteList) {
var whiteListString = $("whiteList").getValue();
var whiteListObject = {};
// This condition is a backward compatibility where the strings looks like : "sogo1=John DOE <sogo1@example.com>"
if (whiteListString.search("=") != -1) {
var split = whiteListString.split("=");
var whiteListObject = {};
whiteListObject[split[0]] = split[1];
}
else if (whiteListString != "") {
var whiteListObject = JSON.parse(whiteListString);
whiteListObject = JSON.parse(whiteListString);
}
var allKeys = Object.keys(whiteListObject);
var allValues = Object.values(whiteListObject);