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

@vranki vranki 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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants