[haiku-commits] r38027 - haiku/trunk/src/apps/aboutsystem

  • From: pulkomandy@xxxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 11 Aug 2010 15:56:39 +0200 (CEST)

Author: pulkomandy
Date: 2010-08-11 15:56:39 +0200 (Wed, 11 Aug 2010)
New Revision: 38027
Changeset: http://dev.haiku-os.org/changeset/38027

Modified:
   haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp
Log:
CID 2001 : be_locale_roster->GetLanguage may fail.


Modified: haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp
===================================================================
--- haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp    2010-08-11 13:53:31 UTC 
(rev 38026)
+++ haiku/trunk/src/apps/aboutsystem/AboutSystem.cpp    2010-08-11 13:56:39 UTC 
(rev 38027)
@@ -178,15 +178,21 @@
        const Translation* rightTranslation = *(const Translation**)right;
 
        BLanguage* language;
-       be_locale_roster->GetLanguage(leftTranslation->languageCode, &language);
        BString leftName;
-       language->GetTranslatedName(leftName);
-       delete language;
+       if (be_locale_roster->GetLanguage(leftTranslation->languageCode, 
&language)
+                       == B_OK) {
+               language->GetTranslatedName(leftName);
+               delete language;
+       } else
+               leftName = leftTranslation->languageCode;
 
-       be_locale_roster->GetLanguage(rightTranslation->languageCode, 
&language);
        BString rightName;
-       language->GetTranslatedName(rightName);
-       delete language;
+       if (be_locale_roster->GetLanguage(rightTranslation->languageCode, 
&language)
+                       == B_OK) {
+               language->GetTranslatedName(rightName);
+               delete language;
+       } else
+               rightName = rightTranslation->languageCode;
 
        BCollator collator;
        be_locale_roster->GetDefaultCollator(&collator);


Other related posts:

  • » [haiku-commits] r38027 - haiku/trunk/src/apps/aboutsystem - pulkomandy