diff --git a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java index b35bc549807..82505f49ee9 100644 --- a/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java +++ b/bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/findandreplace/FindReplaceLogic.java @@ -588,12 +588,11 @@ public void updateTarget(IFindReplaceTarget newTarget, boolean canEditTarget) { this.isTargetEditable = canEditTarget; if (this.target != newTarget) { - if (newTarget != null && newTarget instanceof IFindReplaceTargetExtension) - ((IFindReplaceTargetExtension) newTarget).endSession(); + if (this.target instanceof IFindReplaceTargetExtension) + ((IFindReplaceTargetExtension) this.target).endSession(); this.target = newTarget; - if (newTarget != null) - isTargetSupportingRegEx = newTarget instanceof IFindReplaceTargetExtension3; + isTargetSupportingRegEx = newTarget instanceof IFindReplaceTargetExtension3; if (newTarget instanceof IFindReplaceTargetExtension) { ((IFindReplaceTargetExtension) newTarget).beginSession();