Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D270F17566 for ; Thu, 27 Aug 2015 20:58:46 +0000 (UTC) Received: (qmail 83773 invoked by uid 500); 27 Aug 2015 20:58:46 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 83755 invoked by uid 500); 27 Aug 2015 20:58:46 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 83742 invoked by uid 99); 27 Aug 2015 20:58:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2015 20:58:46 +0000 Date: Thu, 27 Aug 2015 20:58:46 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-9409) getPreferredLanguage crashes with index out of range exception when currentLocale does not contain an '_' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14717511#comment-14717511 ] ASF GitHub Bot commented on CB-9409: ------------------------------------ Github user eymorale commented on the pull request: https://github.com/apache/cordova-plugin-globalization/pull/39#issuecomment-135553374 @shazron Your comparison makes more sense to me as well. I've updated the commit. Thanks! > getPreferredLanguage crashes with index out of range exception when currentLocale does not contain an '_' > --------------------------------------------------------------------------------------------------------- > > Key: CB-9409 > URL: https://issues.apache.org/jira/browse/CB-9409 > Project: Apache Cordova > Issue Type: Bug > Components: Plugin Globalization > Environment: iOS > Reporter: Edna Morales > Assignee: Edna Morales > Priority: Minor > > the getPreferredLanguage function assumes that the returned value of [NSLocale localeIdentifier] contains an '_'. This may be true most of the time, but we have ran into issues where the localeIdentifier does not contain any underscores (could be due to an invalid region being returned?). In any case, we need to handle gracefully when there is no underscore present to avoid an index out of bounds exception -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org