[Opensrf-commits] r1671 - trunk/src/javascript (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 5 21:31:46 EST 2009


Author: erickson
Date: 2009-03-05 21:31:45 -0500 (Thu, 05 Mar 2009)
New Revision: 1671

Modified:
   trunk/src/javascript/DojoSRF.js
Log:
in IE, localeMatch might be null

Modified: trunk/src/javascript/DojoSRF.js
===================================================================
--- trunk/src/javascript/DojoSRF.js	2009-02-28 20:45:41 UTC (rev 1670)
+++ trunk/src/javascript/DojoSRF.js	2009-03-06 02:31:45 UTC (rev 1671)
@@ -21,12 +21,12 @@
         localeRE = /^(\w\w)(-\w\w)?$/;
         localeMatch = localeRE.exec(dojo.locale);
 
-        if (!localeMatch[1]) {
+        if (!localeMatch || !localeMatch[1]) {
                 OpenSRF.locale = dojo.isIE ? navigator.userLanguage : navigator.language;
         } else {
                 OpenSRF.locale = localeMatch[1].toLowerCase();
         }
-        if (localeMatch[2]) {
+        if (localeMatch && localeMatch[2]) {
                 OpenSRF.locale = OpenSRF.locale + localeMatch[2].toUpperCase();
         }
 }



More information about the opensrf-commits mailing list