Piotr Kliczewski has uploaded a new change for review.

Change subject: core: making sure not throw NPE when opening SPICE console
......................................................................

core: making sure not throw NPE when opening SPICE console

When processing console request we get username from db and perform
contains and substring on it. We did not check whether the name is null.
This patch introduces this check.

Bug-Url: https://bugzilla.redhat.com/1120692
Change-Id: Idd5f4a33f8fc5c41faead26afd7ce91c2412ac16
Signed-off-by: pkliczewski <piotr.kliczew...@gmail.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/74/31174/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java
index 107ac94..a03f42b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java
@@ -305,7 +305,7 @@
         final AuditLogableBase event = new AuditLogableBase();
         event.setVmId(vmId);
         String username = vmDynamic.getConsoleCurrentUserName();
-        if(username.contains("@")){
+        if(username!= null && username.contains("@")){
             username = username.substring(0, username.indexOf("@"));
         }
         event.setUserName(username);


-- 
To view, visit http://gerrit.ovirt.org/31174
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd5f4a33f8fc5c41faead26afd7ce91c2412ac16
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Piotr Kliczewski <piotr.kliczew...@gmail.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to