Skip to content

Commit

Permalink
Merge pull request #4 from oviradoi/fix_crash
Browse files Browse the repository at this point in the history
Don't decrement the end iterator for empty vector
  • Loading branch information
kobilutil authored Feb 25, 2017
2 parents 1ba8981 + fa0d3a1 commit 7e729fc
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 7e729fc

Please sign in to comment.