xdbFile is null check

This commit is contained in:
lionsoul2014 2025-12-12 11:58:03 +08:00
parent c2a0a55005
commit c68cc0097c
2 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ public class Config {
sb.append('{'); sb.append('{');
sb.append("cache_policy:").append(cachePolicy).append(','); sb.append("cache_policy:").append(cachePolicy).append(',');
sb.append("version:").append(ipVersion.toString()).append(','); sb.append("version:").append(ipVersion.toString()).append(',');
sb.append("xdb_path:").append(xdbFile.getAbsolutePath()).append(','); sb.append("xdb_path:").append(xdbFile == null ? "null" : xdbFile.getAbsolutePath()).append(',');
sb.append("header:").append(header.toString()).append(','); sb.append("header:").append(header.toString()).append(',');
if (vIndex == null) { if (vIndex == null) {
sb.append("v_index: null, "); sb.append("v_index: null, ");

View File

@ -189,7 +189,7 @@ public class Searcher {
return String.format( return String.format(
"%s->{version:%s, xdb:%s, vIndex:%s, cBuffer:%s}", "%s->{version:%s, xdb:%s, vIndex:%s, cBuffer:%s}",
super.toString(), super.toString(),
version.name, xdbFile.getAbsolutePath(), version.name, xdbFile == null ? "null" : xdbFile.getAbsolutePath(),
vectorIndex == null ? "null" : String.valueOf(vectorIndex.length), vectorIndex == null ? "null" : String.valueOf(vectorIndex.length),
contentBuff == null ? "null" : String.valueOf(contentBuff.length()) contentBuff == null ? "null" : String.valueOf(contentBuff.length())
); );