Skip to content

Commit

Permalink
fix: Additional fixes to prevent null references
Browse files Browse the repository at this point in the history
Signed-off-by: MMaiero <[email protected]>
  • Loading branch information
MMaiero committed May 30, 2024
1 parent 0df76d4 commit 891197b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,16 @@ private void update() {
this.radio2.setValue(true);
this.radio1.setValue(false);
}
this.registration.setText(this.selectedModemIfConfig.getHwRegistration());
this.imsi.setText(this.selectedModemIfConfig.getHwIMSI());
this.iccid.setText(this.selectedModemIfConfig.getHwICCID());
this.plmnid.setText(this.selectedModemIfConfig.getHwPLMNID());
this.network.setText(this.selectedModemIfConfig.getHwNetwork());
this.radio.setText(this.selectedModemIfConfig.getHwRadio());
this.band.setText(this.selectedModemIfConfig.getHwBand());
this.lac.setText(this.selectedModemIfConfig.getHwLAC());
this.ci.setText(this.selectedModemIfConfig.getHwCI());
}
this.registration.setText(this.selectedModemIfConfig.getHwRegistration());
this.imsi.setText(this.selectedModemIfConfig.getHwIMSI());
this.iccid.setText(this.selectedModemIfConfig.getHwICCID());
this.plmnid.setText(this.selectedModemIfConfig.getHwPLMNID());
this.network.setText(this.selectedModemIfConfig.getHwNetwork());
this.radio.setText(this.selectedModemIfConfig.getHwRadio());
this.band.setText(this.selectedModemIfConfig.getHwBand());
this.lac.setText(this.selectedModemIfConfig.getHwLAC());
this.ci.setText(this.selectedModemIfConfig.getHwCI());
refreshForm();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,14 @@ private void update() {
}

private void refreshForm() {
if (this.selectedModemIfConfig.isGpsSupported()) {
this.radio1.setEnabled(true);
this.radio2.setEnabled(true);
} else {
this.radio1.setEnabled(false);
this.radio2.setEnabled(false);
if (this.selectedModemIfConfig != null) {
if (this.selectedModemIfConfig.isGpsSupported()) {
this.radio1.setEnabled(true);
this.radio2.setEnabled(true);
} else {
this.radio1.setEnabled(false);
this.radio2.setEnabled(false);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,9 @@ private void reset() {
this.radio2.setValue(true);
this.radio4.setValue(true);

update();
if (this.selectedNetIfConfig != null) {
update();
}
}

private void initHelpButtons() {
Expand Down Expand Up @@ -1774,37 +1776,34 @@ private void showPasswordVerificationStatus(String statusMessage) {
}

private void loadChannelFrequencies() {
if (this.selectedNetIfConfig != null) {
this.gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() {

@Override
public void onFailure(Throwable ex) {
FailureHandler.handle(ex);
}
this.gwtXSRFService.generateSecurityToken(new AsyncCallback<GwtXSRFToken>() {

@Override
public void onSuccess(GwtXSRFToken token) {
GwtWifiRadioMode radioMode = radioValueToRadioMode(TabWirelessUi.this.radio.getSelectedValue());
@Override
public void onFailure(Throwable ex) {
FailureHandler.handle(ex);
}

TabWirelessUi.this.gwtNetworkService.findFrequencies(token,
TabWirelessUi.this.selectedNetIfConfig.getName(), radioMode,
new AsyncCallback<List<GwtWifiChannelFrequency>>() {
@Override
public void onSuccess(GwtXSRFToken token) {
GwtWifiRadioMode radioMode = radioValueToRadioMode(TabWirelessUi.this.radio.getSelectedValue());

@Override
public void onFailure(Throwable caught) {
logger.info("findFrequencies Failure");
}
TabWirelessUi.this.gwtNetworkService.findFrequencies(token,
TabWirelessUi.this.selectedNetIfConfig.getName(), radioMode,
new AsyncCallback<List<GwtWifiChannelFrequency>>() {

@Override
public void onSuccess(List<GwtWifiChannelFrequency> freqChannels) {
@Override
public void onFailure(Throwable caught) {
logger.info("findFrequencies Failure");
}

updateChannelListValues(freqChannels);
@Override
public void onSuccess(List<GwtWifiChannelFrequency> freqChannels) {
updateChannelListValues(freqChannels);

}
});
}
});
}
}
});
}
});

}

Expand Down

0 comments on commit 891197b

Please sign in to comment.