Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #98 from dart-lang/fix_npe
Browse files Browse the repository at this point in the history
fix an npe in the getPlatformLocale method
  • Loading branch information
devoncarew authored Feb 14, 2017
2 parents 5b4c28a + f2f401e commit e956053
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.packages
.idea/
.pub/
build/
pubspec.lock
8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/usage.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 3.0.0+1
- fixed an NPE in the `usage_io` `getPlatformLocale()` method

## 3.0.0
- removed the use of configurable imports
- removed the Flutter specific entry-point; Flutter apps can now use the
Expand Down
2 changes: 1 addition & 1 deletion lib/src/usage_impl_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ String getPlatformLocale() {
if (locale != null) {
// Convert `en_US.UTF-8` to `en_US`.
int index = locale.indexOf('.');
if (index != null) locale = locale.substring(0, index);
if (index != -1) locale = locale.substring(0, index);

// Convert `en_US` to `en-us`.
locale = locale.replaceAll('_', '-').toLowerCase();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# BSD-style license that can be found in the LICENSE file.

name: usage
version: 3.0.0
version: 3.0.0+1
description: A Google Analytics wrapper for both command-line, web, and Flutter apps.
homepage: https://github.com/dart-lang/usage
author: Dart Team <misc@dartlang.org>
Expand Down

0 comments on commit e956053

Please sign in to comment.