Author: zooey Date: 2010-11-09 23:08:35 +0100 (Tue, 09 Nov 2010) New Revision: 39382 Changeset: http://dev.haiku-os.org/changeset/39382 Ticket: http://dev.haiku-os.org/ticket/6805 Modified: haiku/trunk/src/preferences/locale/LocaleWindow.cpp Log: Fix crash reported in #6805: * check if we actually have a selected item Modified: haiku/trunk/src/preferences/locale/LocaleWindow.cpp =================================================================== --- haiku/trunk/src/preferences/locale/LocaleWindow.cpp 2010-11-09 21:58:54 UTC (rev 39381) +++ haiku/trunk/src/preferences/locale/LocaleWindow.cpp 2010-11-09 22:08:35 UTC (rev 39382) @@ -378,9 +378,14 @@ 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);