summaryrefslogtreecommitdiff
path: root/src/io/OAuthRequester.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/OAuthRequester.java')
-rw-r--r--src/io/OAuthRequester.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/io/OAuthRequester.java b/src/io/OAuthRequester.java
index c3538ee..3621186 100644
--- a/src/io/OAuthRequester.java
+++ b/src/io/OAuthRequester.java
@@ -134,12 +134,9 @@ public class OAuthRequester extends AbstractRequester {
@Override
public boolean isValid() throws IOException {
- if (consumer.getToken() == null) {
- return false;
- }
// NOTE: this actually contributes to the ratelimit (12/minute)
// TODO: find alternative that does not hit the ratelimit
- JSONObject obj = getJSONRelax("application/rate_limit_status");
- return !obj.has("errors");
+ Response obj = getJSON("application/rate_limit_status");
+ return !obj.getResp().getAsJsonObject().has("errors");
}
}