aboutsummaryrefslogtreecommitdiff
path: root/lib/TwitterClient.php
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2023-07-29 00:14:30 +0200
committerGravatar GitHub <noreply@github.com> 2023-07-29 00:14:30 +0200
commit701fe3cfeda0d14f1f49afe2bd0f89296214459e (patch)
tree361c423163f8669ab7b2f278e420a0f1cb666e1c /lib/TwitterClient.php
parent11ce8b5dcd6f9b84249c974f1403a45b5b99d8f5 (diff)
downloadrss-bridge-701fe3cfeda0d14f1f49afe2bd0f89296214459e.tar.gz
rss-bridge-701fe3cfeda0d14f1f49afe2bd0f89296214459e.tar.zst
rss-bridge-701fe3cfeda0d14f1f49afe2bd0f89296214459e.zip
fix: various small fixes (#3578)
Diffstat (limited to 'lib/TwitterClient.php')
-rw-r--r--lib/TwitterClient.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/TwitterClient.php b/lib/TwitterClient.php
index 92c797d6..0c6b9535 100644
--- a/lib/TwitterClient.php
+++ b/lib/TwitterClient.php
@@ -155,7 +155,7 @@ class TwitterClient
throw $e;
}
}
- } else if ($operation == 'By list ID') {
+ } elseif ($operation === 'By list ID') {
$id = $query['listId'];
} else {
throw new \Exception('Unknown operation to make list tweets');
@@ -348,6 +348,11 @@ class TwitterClient
// Grab the first error message
throw new \Exception(sprintf('From twitter api: "%s"', $response->errors[0]->message));
}
+ if (!isset($response->data->user_by_screen_name->list)) {
+ throw new \Exception(
+ sprintf('Unable to find list in twitter response for %s, %s', $screenName, $listSlug)
+ );
+ }
$listInfo = $response->data->user_by_screen_name->list;
$this->data[$screenName . '-' . $listSlug] = $listInfo;