Allow a null FieldDescriptor array so that a dummy FieldMask can be

created which let's anything go


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2279 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mjohnson
2008-03-21 01:47:46 +00:00
parent 6253530d1e
commit 277454fe78
@@ -54,7 +54,7 @@ public class FieldMask
{ {
// create a mapping from field name to descriptor index // create a mapping from field name to descriptor index
_descripMap = new HashMap<String,Integer>(); _descripMap = new HashMap<String,Integer>();
int dcount = descrips.length; int dcount = (descrips == null ? 0 : descrips.length);
for (int i = 0; i < dcount; i++) { for (int i = 0; i < dcount; i++) {
_descripMap.put(descrips[i].field.getName(), Integer.valueOf(i)); _descripMap.put(descrips[i].field.getName(), Integer.valueOf(i));
} }