Skip to content

Commit

Permalink
Fix crash with empty attribute list
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro authored and m-kuhn committed Apr 30, 2014
1 parent 19f226a commit a704b9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/qgsattributedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ void QgsAttributeDialog::init()
// Set focus to first widget in list, to help entering data without moving the mouse.
if ( mypInnerLayout->rowCount() > 0 )
{
QWidget* widget = mypInnerLayout->itemAtPosition( 0, 1 )->widget();
if ( widget )
widget->setFocus( Qt::OtherFocusReason );
QLayoutItem* item = mypInnerLayout->itemAtPosition( 0, 1 );
if ( item && item->widget() )
item->widget()->setFocus( Qt::OtherFocusReason );
}

QSpacerItem *mypSpacer = new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding );
Expand Down

0 comments on commit a704b9f

Please sign in to comment.