changeset 1678:f54484aae295

fix
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 31 May 2022 14:44:29 -0600
parents ea7075b7afe1
children 39287902fb0c
files src/goodjava/lucene/logging/LoggingIndexWriter.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
diff -r ea7075b7afe1 -r f54484aae295 src/goodjava/lucene/logging/LoggingIndexWriter.java
--- a/src/goodjava/lucene/logging/LoggingIndexWriter.java	Tue May 31 14:36:16 2022 -0600
+++ b/src/goodjava/lucene/logging/LoggingIndexWriter.java	Tue May 31 14:44:29 2022 -0600
@@ -73,7 +73,8 @@
 		if( indexFile.exists() ) {
 			try {
 				Map map = (Map)JsonParser.parse( IoUtils.readAll(new FileReader(indexFile)) );
-				if( (Integer)map.get("version") == version ) {
+				Number num = (Number)map.get("version");
+				if( num != null && num.intValue() == version ) {
 					List fileNames = (List)map.get("files");
 					for( int i=0; i<logs.length; i++ ) {
 						File file = new File( logDir, (String)fileNames.get(i) );