diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2017-10-03 01:46:48 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2017-10-03 01:46:48 +0000 |
commit | 30cd79721fc498498f5c2808ccc27ba19c121fe5 (patch) | |
tree | 0bcec223a2bd995e33e1acd831a67eb31d98510d | |
parent | 9591a1f121edf0fdb686fd24c60c1708c363cd05 (diff) | |
download | jackcess-30cd79721fc498498f5c2808ccc27ba19c121fe5.tar.gz jackcess-30cd79721fc498498f5c2808ccc27ba19c121fe5.zip |
Fix writing of property maps without any properties. fixes #144
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1122 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r-- | src/changes/changes.xml | 3 | ||||
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 53330ef..0134a35 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -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"> diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java b/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java index 01d4dfd..3a63aba 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java @@ -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(); |