Skip to content

Commit 290b023

Browse files
committed
Don't try to pin a NULL post on Mastodon
1 parent 00d171a commit 290b023

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pgweb/util/socialposter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def set_pin(self, postid):
8383
if r2.status_code != 200:
8484
print("Failed to unpin from mastodon: {}".format(r2.text))
8585

86-
if not found:
86+
if not found and postid is not None:
8787
# Not already pinned, so pin!
8888
r2 = requests.post(
8989
'{}/api/v1/statuses/{}/pin'.format(self.settings.MASTODON_BASEURL, postid),

0 commit comments

Comments
 (0)