Skip to content

Commit

Permalink
Engine: fixed MessageBuffer/PersistentSqlite/MaxCapacity log error (c…
Browse files Browse the repository at this point in the history
…loses: #1073)

Accessing a config key without a default value is not valid config access, as
each key must have a default value so no valid key will ever return null. This
also caused ERROR log entries, to identify such incorrect config use.
  • Loading branch information
meebey committed Jul 14, 2015
1 parent 892415d commit 54522cf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Engine/Chats/ChatModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ public void ApplyConfig(UserConfig config)
}
InitMessageBuffer(persistency);

var maxCapacityKey = String.Format("MessageBuffer/{0}/MaxCapacity",
persistency.ToString());
if (config[maxCapacityKey] == null &&
persistency.ToString().StartsWith("Persistent")) {
string maxCapacityKey;
if (persistency == MessageBufferPersistencyType.Volatile) {
maxCapacityKey = "MessageBuffer/Volatile/MaxCapacity";
} else {
maxCapacityKey = "MessageBuffer/Persistent/MaxCapacity";
}
MessageBuffer.MaxCapacity = (int) config[maxCapacityKey];
Expand Down

0 comments on commit 54522cf

Please sign in to comment.