Skip to content

Commit

Permalink
properly handle the empty map exception
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar committed Dec 9, 2023
1 parent 1d930e9 commit 2356bc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'com.nucleodb'
version = '1.13.9'
version = '1.13.10'

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,15 @@ public Set<DataEntry> get(String key, Object value, DataEntryProjection dataEntr
dataEntryProjection = new DataEntryProjection();
}
if (key.equals("id")) {
Set<DataEntry> entrySet = new TreeSet(Arrays.asList(this.keyToEntry.get(value)));
Stream<DataEntry> process = dataEntryProjection.process(entrySet.stream());
if(dataEntryProjection.isWritable()) {
return process.map(de -> (DataEntry) de.copy(this.getConfig().getDataEntryClass())).collect(Collectors.toSet());
if(this.keyToEntry.size()>0) {
Set<DataEntry> entrySet = new TreeSet(Arrays.asList(this.keyToEntry.get(value)));
Stream<DataEntry> process = dataEntryProjection.process(entrySet.stream());
if (dataEntryProjection.isWritable()) {
return process.map(de -> (DataEntry) de.copy(this.getConfig().getDataEntryClass())).collect(Collectors.toSet());
}
return process.collect(Collectors.toSet());
}
return process.collect(Collectors.toSet());
return new TreeSet<>();
}
IndexWrapper<DataEntry> dataEntryIndexWrapper = this.indexes.get(key);
return handleIndexOperation(value, dataEntryProjection, dataEntryIndexWrapper::get);
Expand Down

0 comments on commit 2356bc4

Please sign in to comment.