Vojtech Szocs has uploaded a new change for review. Change subject: webadmin: Fix NPE in HostListModel ......................................................................
webadmin: Fix NPE in HostListModel This patch fixes a potential NPE regarding "SSH username" field. Change-Id: I5ef7002d81819dd77fff1ef372e4722ca5fa6d35 Signed-off-by: Vojtech Szocs <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/16/17116/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java index 531d265..08b5b1d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostListModel.java @@ -840,8 +840,9 @@ host.setHostName((String) model.getHost().getEntity()); host.setPort(Integer.parseInt(model.getPort().getEntity().toString())); host.setSshPort(Integer.parseInt(model.getHostPort().getEntity().toString())); - host.setSshUsername(model.getUserName().getEntity().toString()); - boolean sshFpSet = (Boolean) (model.getFetchSshFingerprint().getEntity() != null); + boolean sshUsernameSet = model.getUserName().getEntity() != null; + host.setSshUsername(sshUsernameSet ? model.getUserName().getEntity().toString() : null); + boolean sshFpSet = model.getFetchSshFingerprint().getEntity() != null; host.setSshKeyFingerprint(!sshFpSet ? null : (String) model.getFetchSshFingerprint().getEntity()); host.setVdsSpmPriority(model.getSpmPriorityValue()); boolean consoleAddressSet = (Boolean) model.getConsoleAddressEnabled().getEntity(); -- To view, visit http://gerrit.ovirt.org/17116 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ef7002d81819dd77fff1ef372e4722ca5fa6d35 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Vojtech Szocs <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
