if (tree != null) { lastPath = tree.getSelectionPath(); if (lastPath != null)
if (tree != null && lastPath != null)
  private void configureEditingComponent(JTree tree,                                         DefaultTreeCellRenderer renderer,                                         TreeCellEditor editor)  {    if (tree != null)      {        lastPath = tree.getSelectionPath();        if (lastPath != null)          {            lastRow = tree.getRowForPath(lastPath);            Object val = lastPath.getLastPathComponent();            boolean isLeaf = tree.getModel().isLeaf(val);            boolean expanded = tree.isExpanded(lastPath);            determineOffset(tree, val, true, expanded, isLeaf, lastRow);            editingComponent = editor.getTreeCellEditorComponent(tree, val,                                                                 true,                                                                 expanded,                                                                 isLeaf,                                                                 lastRow);          }      }  }