Skip to content

Commit e2ad41c

Browse files
fix(ui): initialize unconfigured wireless interface to resolve NPE, fix channel selection on hardware tab, fix validation message on empty password (#11)
* fix(ui): fix un-initialized GwtNetInterfaceConfig for active wifi configuration, set to DISABLED Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com> * fix(ui): fix channel text selection for wireless Hardware tab, could cause ArrayOutOfBoundsException Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com> * fix(ui): change validator order to check first for password emptyness Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com> --------- Signed-off-by: Marcello Rinaldo Martina <martina.marcello.rinaldo@outlook.com> Co-authored-by: Salvatore Coppola <83589980+salvatore-coppola@users.noreply.github.com>
1 parent 5b22755 commit e2ad41c

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/network/TabWirelessUi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,7 @@ private void updateChannelListValues(List<GwtWifiChannelFrequency> freqChannels)
17941794
if (this.activeConfig != null && this.activeConfig.getChannels() != null
17951795
&& !this.activeConfig.getChannels().isEmpty()) {
17961796
this.netTabs.hardwareTab.channel
1797-
.setText(this.channelList.getItemText(this.activeConfig.getChannels().get(0)));
1797+
.setText(this.channelList.getItemText(selectedChannelValue));
17981798

17991799
this.channelList.setSelectedIndex(selectedChannelValue);
18001800
}

bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/client/ui/validator/GwtValidators.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public static List<Validator<String>> newPassword(final Optional<String> identit
5353

5454
final List<Validator<String>> defaultValidators = new ArrayList<>();
5555

56+
defaultValidators.add(nonEmpty(MSGS.pwdEmpty()));
5657
defaultValidators.add(stringLength(255, MSGS.pwdMaxLength()));
5758
defaultValidators.add(noWhitespaceCharacters(MSGS.pwdWhitespaceCharacters()));
58-
defaultValidators.add(nonEmpty(MSGS.pwdEmpty()));
5959

6060
identityName.ifPresent(
6161
id -> defaultValidators.add(notEqualsIdentityName(id, MSGS.pwdStrengthNotEqualsIdentityName())));

bundles/org.eclipse.kura.web2/src/main/java/org/eclipse/kura/web/shared/model/GwtWifiNetInterfaceConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ public void setWifiConfig(GwtWifiConfig wifiConfig) {
110110

111111
public GwtWifiConfig getActiveWifiConfig() {
112112
GwtWifiWirelessMode wifiMode = getWirelessModeEnum();
113-
GwtWifiConfig activeConfig = null;
113+
GwtWifiConfig activeConfig = new GwtWifiConfig();
114+
activeConfig.setWirelessMode(wifiMode.name());
114115

115116
if (wifiMode.equals(GwtWifiWirelessMode.netWifiWirelessModeAccessPoint)) {
116117
activeConfig = this.m_accessPointWifiConfig;

0 commit comments

Comments
 (0)