diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4c1a25fc077..7d347a0b450 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -41,6 +41,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Deprecated and removed functionality of the `connectOnStartup` option in `gremlin-javascript` to resolve potential `unhandledRejection` and race conditions. * Fixed potential `NullPointerException` in `gremlin-driver` where initialization of a `ConnectionPool` would fail but not throw an exception due to centralized error check being satisfied by a different process. * Fixed a bug where the JavaScript client would hang indefinitely on traversals if the connection to the server was terminated. +* Fixed Traversal.graph is empty in StepStrategy.apply() with `count().is(0)`. [[release-3-5-3]] === TinkerPop 3.5.3 (Release Date: April 4, 2022) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java index 3def9691473..d0832f68e1b 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategy.java @@ -164,6 +164,7 @@ public void apply(final Traversal.Admin traversal) { } else { inner = __.identity().asAdmin(); } + traversal.getGraph().ifPresent(graph -> inner.setGraph(graph)); if (prev != null) TraversalHelper.replaceStep(prev, new NotStep<>(traversal, inner), traversal); else