details:   /erp/devel/pi/rev/fff807103417
changeset: 9297:fff807103417
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed Dec 22 11:37:46 2010 +0100
summary:   Made test on view more precise, prevent NPE and other errors

diffstat:

 src/org/openbravo/dal/service/OBDal.java |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r f6e784da4776 -r fff807103417 src/org/openbravo/dal/service/OBDal.java
--- a/src/org/openbravo/dal/service/OBDal.java  Wed Dec 22 11:07:11 2010 +0100
+++ b/src/org/openbravo/dal/service/OBDal.java  Wed Dec 22 11:37:46 2010 +0100
@@ -143,7 +143,7 @@
 
     // prevent saving of db view objects, this can happen for example if 
someone accidentally
     // exported views in xml and then imports this xml again
-    if (((BaseOBObject) obj).getEntity().isView()) {
+    if (obj instanceof BaseOBObject && ((BaseOBObject) 
obj).getEntity().isView()) {
       log.warn("Trying to save an object which is a db-view, ignoring save 
operation, entity: "
           + ((BaseOBObject) obj).getEntity().getName());
       return;
@@ -176,7 +176,7 @@
 
     // prevent removing of db view objects, this can happen for example if 
someone accidentally
     // exported views in xml and posts this xml using a webservice
-    if (((BaseOBObject) obj).getEntity().isView()) {
+    if (obj instanceof BaseOBObject && ((BaseOBObject) 
obj).getEntity().isView()) {
       log.warn("Trying to remove an object which is a db-view, ignoring remove 
operation, entity: "
           + ((BaseOBObject) obj).getEntity().getName());
       return;

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to