changeset 1526:efbc3720d3f3

postgres backup fix
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 24 Jul 2020 23:09:34 -0600
parents f848d40b3b07
children fa1e3adbebfb
files src/luan/modules/lucene/LuceneIndex.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
diff -r f848d40b3b07 -r efbc3720d3f3 src/luan/modules/lucene/LuceneIndex.java
--- a/src/luan/modules/lucene/LuceneIndex.java	Sat Jul 18 20:41:47 2020 -0600
+++ b/src/luan/modules/lucene/LuceneIndex.java	Fri Jul 24 23:09:34 2020 -0600
@@ -1010,14 +1010,18 @@
 
 	private static Map toJava(LuanTable t) throws LuanException {
 		Map map = t.asMap();
-		for( Object obj : map.entrySet() ) {
-			Map.Entry entry = (Map.Entry)obj;
+		for( Iterator iter = map.entrySet().iterator(); iter.hasNext(); ) {
+			Map.Entry entry = (Map.Entry)iter.next();
 			Object value = entry.getValue();
 			if( value instanceof LuanTable ) {
 				LuanTable v = (LuanTable)value;
 				if( !v.isList() )
 					logger.error("not list");
-				entry.setValue(v.asList());
+				if( v.isEmpty() ) {
+					iter.remove();
+				} else {
+					entry.setValue(v.asList());
+				}
 			}
 		}
 		return map;