diff --git a/src/main/java/org/mastodon/mamut/clustering/treesimilarity/tree/BranchSpotTree.java b/src/main/java/org/mastodon/mamut/clustering/treesimilarity/tree/BranchSpotTree.java index ae2d51415..bf8e9aca9 100644 --- a/src/main/java/org/mastodon/mamut/clustering/treesimilarity/tree/BranchSpotTree.java +++ b/src/main/java/org/mastodon/mamut/clustering/treesimilarity/tree/BranchSpotTree.java @@ -169,7 +169,16 @@ public void setParams( final boolean includeName, final boolean includeTag, fina private String getTagLabel() { Spot ref = model.getGraph().vertexRef(); - String tagLabel = LegacyTagSetUtils.getTagLabel( model, branchSpot, tagSet, ref ); + String tagLabel = null; + try + { + // TODO: this try-catch block is a workaround. It will not be needed anymore after mastodon-core beta-34 + tagLabel = LegacyTagSetUtils.getTagLabel( model, branchSpot, tagSet, ref ); + } + catch ( NullPointerException e ) + { + // happens, when the branchSpot is not in the model anymore + } model.getGraph().releaseRef( ref ); if ( tagLabel == null ) tagLabel = "";