Skip to content

Commit 4e526f1

Browse files
authored
fix(appId): Trim() app keys to avoid IllegalArgumentException in User… (#102)
* fix(appId): Trim() app keys to avoid IllegalArgumentException in User-Agent. * fix(keys): null checkers.
1 parent bc1401d commit 4e526f1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

AndroidSDK/src/com/leanplum/internal/Request.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import android.os.AsyncTask;
2727
import android.os.Build;
2828
import android.support.annotation.NonNull;
29+
import android.text.TextUtils;
2930

3031
import com.leanplum.Leanplum;
3132
import com.leanplum.utils.SharedPreferencesUtil;
@@ -103,8 +104,12 @@ public class Request {
103104
}
104105

105106
public static void setAppId(String appId, String accessKey) {
106-
Request.appId = appId;
107-
Request.accessKey = accessKey;
107+
if (!TextUtils.isEmpty(appId)) {
108+
Request.appId = appId.trim();
109+
}
110+
if (!TextUtils.isEmpty(accessKey)) {
111+
Request.accessKey = accessKey.trim();
112+
}
108113
}
109114

110115
public static void setDeviceId(String deviceId) {

0 commit comments

Comments
 (0)