Skip to content

Commit 10bd6bc

Browse files
committed
Validate that sizeInBytes is >= 0 to avoid UnsupportedOperationException
1 parent 0c90455 commit 10bd6bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/src/main/java/org/neo4j/gds/api/CSRGraphStoreFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ protected CSRGraphStore createGraphStore(
5858

5959
protected void logLoadingSummary(GraphStore graphStore) {
6060
var sizeInBytes = MemoryUsage.sizeOf(graphStore);
61-
var memoryUsage = MemoryUsage.humanReadable(sizeInBytes);
62-
progressTracker.logInfo(formatWithLocale("Actual memory usage of the loaded graph: %s", memoryUsage));
61+
if (sizeInBytes >= 0) {
62+
var memoryUsage = MemoryUsage.humanReadable(sizeInBytes);
63+
progressTracker.logInfo(formatWithLocale("Actual memory usage of the loaded graph: %s", memoryUsage));
64+
}
6365
}
6466

6567
protected abstract GraphSchema computeGraphSchema(

0 commit comments

Comments
 (0)