Skip to content

Commit a704b9f

Browse files
manisandrom-kuhn
authored andcommittedApr 30, 2014
Fix crash with empty attribute list
1 parent 19f226a commit a704b9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/gui/qgsattributedialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ void QgsAttributeDialog::init()
285285
// Set focus to first widget in list, to help entering data without moving the mouse.
286286
if ( mypInnerLayout->rowCount() > 0 )
287287
{
288-
QWidget* widget = mypInnerLayout->itemAtPosition( 0, 1 )->widget();
289-
if ( widget )
290-
widget->setFocus( Qt::OtherFocusReason );
288+
QLayoutItem* item = mypInnerLayout->itemAtPosition( 0, 1 );
289+
if ( item && item->widget() )
290+
item->widget()->setFocus( Qt::OtherFocusReason );
291291
}
292292

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

0 commit comments

Comments
 (0)
Please sign in to comment.