Skip to content

Commit

Permalink
Fixed decrementing iterator for empty vector
Browse files Browse the repository at this point in the history
  • Loading branch information
oviradoi committed Feb 25, 2017
1 parent 1ba8981 commit fa0d3a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Explorer/src/FileList/FileList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2144,7 +2144,8 @@ void FileList::OffsetItr(INT offsetItr, vector<string> & vStrItems)

void FileList::UpdateToolBarElements(void)
{
_pToolBar->enable(_idRedo, _itrPos != _vDirStack.end() - 1);
bool canRedo = !_vDirStack.empty() && (_itrPos != _vDirStack.end() - 1);
_pToolBar->enable(_idRedo, canRedo);
_pToolBar->enable(_idUndo, _itrPos != _vDirStack.begin());
}

Expand Down

0 comments on commit fa0d3a1

Please sign in to comment.