[cvs] expresso commit by lhamel: protect against null valid values
JCorporate Ltd
jcorp at jcorporate.com
Mon Jun 13 04:54:31 UTC 2005
Log Message:
-----------
protect against null valid values
Modified Files:
--------------
expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj:
DBObject.java
Revision Data
-------------
Index: DBObject.java
===================================================================
RCS file: /home/javacorp/.cvs/expresso/expresso/expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java,v
retrieving revision 1.251
retrieving revision 1.252
diff -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java -Lexpresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java -u -r1.251 -r1.252
--- expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java
+++ expresso-web/WEB-INF/src/com/jcorporate/expresso/core/dbobj/DBObject.java
@@ -3838,7 +3838,16 @@
* @throws DBException upon error
*/
public java.util.List getValidValuesList(String fieldName) throws DBException {
- return new ArrayList(getValidValuesPriv(fieldName));
+ Vector valVector = getValidValuesPriv(fieldName);
+ ArrayList result = null;
+ if ( valVector == null ) {
+ result = new ArrayList();
+ }
+ else {
+ result = new ArrayList(valVector);
+ }
+
+ return result;
}
/**
@@ -3856,7 +3865,9 @@
*/
public synchronized Vector getValidValues(String fieldName)
throws DBException {
- return getValidValuesPriv(fieldName);
+ Vector result = getValidValuesPriv(fieldName);
+ if ( result == null ) result = new Vector();
+ return result;
} /* getValidValues(String) */
/**
More information about the cvs
mailing list