From: James Ahlborn Date: Tue, 3 Oct 2017 01:46:48 +0000 (+0000) Subject: Fix writing of property maps without any properties. fixes #144 X-Git-Tag: jackcess-2.1.9~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=30cd79721fc498498f5c2808ccc27ba19c121fe5;p=jackcess.git 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 --- 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 @@ Handle more advanced query join constructs. + + Fix writing of property maps without any properties. + 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 } } + 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();