Skip to content

Commit 321dd74

Browse files
committed
Fixed #23
1 parent 1c53aa5 commit 321dd74

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ public void makeRequest(
225225
httpVerb = Verb.GET;
226226
}
227227

228-
final ReadableMap requestParams = ((Map<String,ReadableMap>) params).get("params");
228+
ReadableMap requestParams = null;
229+
if (params != null && params.hasKey("params")) {
230+
requestParams = params.getMap("params");
231+
}
229232
OAuthRequest request = oauthRequestWithParams(providerName, cfg, authVersion, httpVerb, url, requestParams);
230233

231234
if (authVersion.equals("1.0")) {
@@ -277,7 +280,7 @@ private OAuthRequest oauthRequestWithParams(
277280
final String authVersion,
278281
final Verb httpVerb,
279282
final URL url,
280-
final ReadableMap params
283+
@Nullable final ReadableMap params
281284
) throws Exception {
282285
OAuthRequest request;
283286

@@ -295,7 +298,7 @@ private OAuthRequest oauthRequestWithParams(
295298
throw new Exception("Provider not handled yet");
296299
}
297300
// Params
298-
if (params.hasKey("params")) {
301+
if (params != null && params.hasKey("params")) {
299302
ReadableMapKeySetIterator iterator = params.keySetIterator();
300303
while (iterator.hasNextKey()) {
301304
String key = iterator.nextKey();

0 commit comments

Comments
 (0)