From 30cd79721fc498498f5c2808ccc27ba19c121fe5 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Tue, 3 Oct 2017 01:46:48 +0000 Subject: [PATCH] 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 --- src/changes/changes.xml | 3 +++ .../healthmarketscience/jackcess/impl/PropertyMaps.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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(); -- 2.39.5