Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash if invalid row given. #115

Closed
wants to merge 1 commit into from

Conversation

@vranki
Copy link

commented Aug 25, 2014

Return null instead of crashing if row is invalid.

@@ -700,7 +700,10 @@ bool SeasideFilteredModel::savePerson(SeasidePerson *person)

SeasidePerson *SeasideFilteredModel::personByRow(int row) const
{
return personFromItem(SeasideCache::itemById(m_contactIds->at(row)));
if (row >= 0 && row < m_allContactIds->size()) {
return personFromItem(m_allContactIds->at(row));

This comment has been minimized.

Copy link
@SfietKonstantin

SfietKonstantin Aug 25, 2014

Member

Old code was "return SeasideCache::itemById(m_contactIds->at(row))"
yours is return m_contactIds->at(row). You missed something here ;)

@vranki vranki closed this Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.