Fix crash reported in #6805:

* check if we actually have a selected item

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39382 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2010-11-09 22:08:35 +00:00
parent 71dc3c41c3
commit 612333a601
+5
View File
@@ -378,9 +378,14 @@ LocaleWindow::MessageReceived(BMessage* message)
break;
BListView* conventionsList = static_cast<BListView*>(listView);
if (conventionsList == NULL)
break;
LanguageListItem* item = static_cast<LanguageListItem*>
(conventionsList->ItemAt(conventionsList->CurrentSelection()));
if (item == NULL)
break;
BFormattingConventions conventions(item->ID());
gMutableLocaleRoster->SetDefaultFormattingConventions(conventions);