anmolbabu has uploaded a new change for review.

Change subject: webadmin : Fix DaysOfMonthSelector coverity scan defects
......................................................................

webadmin : Fix DaysOfMonthSelector coverity scan defects

This patch places a null check on the cellClicked
to overcome the Null pointer dereferences issue
reported by coverity scan.

Change-Id: I8c1ba079ee40da217ef44a770849af468c8a226b
Signed-off-by: Anmol Babu <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/DaysOfMonthSelector.java
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/38869/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/DaysOfMonthSelector.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/DaysOfMonthSelector.java
index 5655b77..86766b8 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/DaysOfMonthSelector.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/DaysOfMonthSelector.java
@@ -59,15 +59,17 @@
             @Override
             public void onClick(ClickEvent event) {
                 Cell cellClicked = daysOfMonth.getCellForEvent(event);
-                int cellColumn = cellClicked.getCellIndex();
-                int cellRow = cellClicked.getRowIndex();
-                int actualCellIndex = (cellRow - 1) * DAYS_IN_WEEK + 
cellColumn;
-                if (!clickedList.get(actualCellIndex)) {
-                    ValueChangeEvent.fire(DaysOfMonthSelector.this,
+                if (cellClicked != null) {
+                    int cellColumn = cellClicked.getCellIndex();
+                    int cellRow = cellClicked.getRowIndex();
+                    int actualCellIndex = (cellRow - 1) * DAYS_IN_WEEK + 
cellColumn;
+                    if (!clickedList.get(actualCellIndex)) {
+                        ValueChangeEvent.fire(DaysOfMonthSelector.this,
                             addSelectedDate(getValue(), 
getDateFromIndex(actualCellIndex)));
-                } else {
-                    ValueChangeEvent.fire(DaysOfMonthSelector.this,
+                    } else {
+                        ValueChangeEvent.fire(DaysOfMonthSelector.this,
                             removeSelectedDate(getValue(), 
getDateFromIndex(actualCellIndex)));
+                    }
                 }
             }
         });


-- 
To view, visit https://gerrit.ovirt.org/38869
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c1ba079ee40da217ef44a770849af468c8a226b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to