Only enable CUI support when the message is valid.

Also the check if support isn't already enabled is not really needed, as it will just overwrite the field with the same value.
This commit is contained in:
ReneZeidler 2014-02-01 08:30:40 -08:00
parent c47f50696d
commit be8bb784f8

View File

@ -605,12 +605,9 @@ public class LocalSession {
} }
public void handleCUIInitializationMessage(String text) { public void handleCUIInitializationMessage(String text) {
if(!hasCUISupport()) {
setCUISupport(true);
}
String[] split = text.split("\\|"); String[] split = text.split("\\|");
if (split.length > 1 && split[0].equalsIgnoreCase("v")) { // enough fields and right message if (split.length > 1 && split[0].equalsIgnoreCase("v")) { // enough fields and right message
setCUISupport(true);
try { try {
setCUIVersion(Integer.parseInt(split[1])); setCUIVersion(Integer.parseInt(split[1]));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {