]> source.dussan.org Git - jackcess.git/commitdiff
Fix writing of property maps without any properties. fixes #144
authorJames Ahlborn <jtahlborn@yahoo.com>
Tue, 3 Oct 2017 01:46:48 +0000 (01:46 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Tue, 3 Oct 2017 01:46:48 +0000 (01:46 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1122 f203690c-595d-4dc9-a70b-905162fa7fd2

src/changes/changes.xml
src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java

index 53330ef03c257d5e03847b0a1d80db6db3cff872..0134a3505ca1163f771f4d678645649424d54bb2 100644 (file)
@@ -8,6 +8,9 @@
       <action dev="jahlborn" type="fix" system="SourceForge2" issue="141">
         Handle more advanced query join constructs.
       </action>
+      <action dev="jahlborn" type="fix" system="SourceForge2" issue="144">
+        Fix writing of property maps without any properties.
+      </action>
     </release>
     <release version="2.1.8" date="2017-06-25">
       <action dev="jahlborn" type="fix" system="SourceForge2" issue="142">
index 01d4dfdf075f4809f16a7e67f15512f3288a54cf..3a63abaf1a45b0373c2b26aa0fb44cceb1776b7e 100644 (file)
@@ -213,12 +213,18 @@ public class PropertyMaps implements Iterable<PropertyMapImpl>
         }
       }
 
+      if(propNames.isEmpty()) {
+        return null;
+      }
+
       // write the full set of property names
       writeBlock(null, propNames, PROPERTY_NAME_LIST, bab);
 
       // write all the map values
       for(PropertyMapImpl propMap : maps) {
-        writeBlock(propMap, propNames, propMap.getType(), bab);
+        if(!propMap.isEmpty()) {
+          writeBlock(propMap, propNames, propMap.getType(), bab);
+        }
       }
       
       return bab.toArray();