code: protected static SiteNode getSiteNode(HistoryReference historyReference) {
          SiteNode sn = historyReference.getSiteNode();
          if (sn == null) {
              sn = Model.getSingleton().getSession().getSiteTree().getSiteNode(historyReference.getHistoryId());
          }
          return sn;
      }
docs: Convenience method that extracts a {@code SiteNode} from the given {@code historyReference}. If no {@code SiteNode} is
  found {@code null} is returned.
  
  @param historyReference the history reference
  @return the {@code SiteNode} or {@code null} if not found
  @see #isButtonEnabledForHistoryReference(HistoryReference)