Skip to content

Commit

Permalink
fixed NRE
Browse files Browse the repository at this point in the history
  • Loading branch information
retailcoder committed Oct 5, 2016
1 parent 3ec6220 commit ee95ad8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions RetailCoder.VBE/Refactorings/Rename/RenamePresenterFactory.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Rubberduck.Parsing.VBA;
using Rubberduck.UI;
using Rubberduck.VBEditor;
using Rubberduck.VBEditor.DisposableWrappers;
using Rubberduck.VBEditor.DisposableWrappers.VBA;

namespace Rubberduck.Refactorings.Rename
Expand All @@ -24,14 +23,11 @@ public RenamePresenterFactory(VBE vbe, IRenameDialog view, RubberduckParserState
public RenamePresenter Create()
{
var codePane = _vbe.ActiveCodePane;
{
var selection = codePane.GetSelection();
var qualifiedSelection = codePane.IsWrappingNullReference
? new QualifiedSelection()
: new QualifiedSelection(new QualifiedModuleName(codePane.CodeModule.Parent), selection);
var qualifiedSelection = codePane.IsWrappingNullReference
? new QualifiedSelection()
: new QualifiedSelection(new QualifiedModuleName(codePane.CodeModule.Parent), codePane.GetSelection());

return new RenamePresenter(_view, new RenameModel(_vbe, _state, qualifiedSelection, _messageBox));
}
return new RenamePresenter(_view, new RenameModel(_vbe, _state, qualifiedSelection, _messageBox));
}
}
}

0 comments on commit ee95ad8

Please sign in to comment.