Github user rvesse commented on a diff in the pull request: https://github.com/apache/jena/pull/407#discussion_r183809337 --- Diff: jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/DatasetGraphSwitchable.java --- @@ -111,7 +112,8 @@ public Graph getDefaultGraph() { @Override public Graph getGraph(Node gn) { - return ngCache.getOrFill(gn, ()->GraphViewSwitchable.createNamedGraph(this, gn)); + Node key = ( gn != null ) ? gn : Quad.defaultGraphNodeGenerated; + return ngCache.getOrFill(gn, ()->GraphViewSwitchable.createNamedGraph(this, key)); --- End diff -- Shouldn't the first `gn` reference on this line also be changed to `key` otherwise you are adding a potentially `null` key to the cache
---