From 612333a601894e3f9b43344f9286bb46dc653bde Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Tue, 9 Nov 2010 22:08:35 +0000 Subject: [PATCH] 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 --- src/preferences/locale/LocaleWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/preferences/locale/LocaleWindow.cpp b/src/preferences/locale/LocaleWindow.cpp index 6e4af0b055..5ba2200f3e 100644 --- a/src/preferences/locale/LocaleWindow.cpp +++ b/src/preferences/locale/LocaleWindow.cpp @@ -378,9 +378,14 @@ LocaleWindow::MessageReceived(BMessage* message) break; BListView* conventionsList = static_cast(listView); + if (conventionsList == NULL) + break; LanguageListItem* item = static_cast (conventionsList->ItemAt(conventionsList->CurrentSelection())); + if (item == NULL) + break; + BFormattingConventions conventions(item->ID()); gMutableLocaleRoster->SetDefaultFormattingConventions(conventions);