diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2013-09-12 20:38:33 +0200 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2013-09-12 20:38:33 +0200 |
| commit | f9988fb005f132a05e626e987d04b06480a04642 (patch) | |
| tree | 1b1d4df0305fb890ce90e10331801b1c1db6ccb2 | |
| parent | f68e585255f7e0b0b77be0e152e66554d6302f1c (diff) | |
| download | cgeo-f9988fb005f132a05e626e987d04b06480a04642.zip cgeo-f9988fb005f132a05e626e987d04b06480a04642.tar.gz cgeo-f9988fb005f132a05e626e987d04b06480a04642.tar.bz2 | |
refactoring: fix potential null pointer
| -rw-r--r-- | main/src/cgeo/geocaching/utils/TranslationUtils.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/utils/TranslationUtils.java b/main/src/cgeo/geocaching/utils/TranslationUtils.java index 1224f7e..03ec256 100644 --- a/main/src/cgeo/geocaching/utils/TranslationUtils.java +++ b/main/src/cgeo/geocaching/utils/TranslationUtils.java @@ -3,6 +3,8 @@ package cgeo.geocaching.utils; import cgeo.geocaching.activity.AbstractActivity; import cgeo.geocaching.network.Network; +import org.apache.commons.lang3.StringUtils; + import android.content.Intent; import android.net.Uri; @@ -36,7 +38,7 @@ public final class TranslationUtils { String content = Network.encode(text); // the app works better without the "+", the website works better with "+", therefore assume using the app if installed if (ProcessUtils.isLaunchable(TRANSLATION_APP)) { - content = content.replace("+", "%20"); + content = StringUtils.replace(content, "+", "%20"); } return translationWebsite + translationForceClassicMode + translationAutoSelect + translationFieldSeparator + toLang + translationFieldSeparator + content; } |
