aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2017-10-03 01:46:48 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2017-10-03 01:46:48 +0000
commit30cd79721fc498498f5c2808ccc27ba19c121fe5 (patch)
tree0bcec223a2bd995e33e1acd831a67eb31d98510d
parent9591a1f121edf0fdb686fd24c60c1708c363cd05 (diff)
downloadjackcess-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.xml3
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/PropertyMaps.java8
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();