From 129ea69ccf102612b4c9cbb52a8814c3e8f8d8a4 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Mon, 25 Nov 2024 09:02:26 +0100 Subject: [PATCH] EMA: Fix fatal when account is invalid (#1014) * EMA: Fix fatal when account is invalid * Add changelog * Add readme.txt entry --- CHANGELOG.md | 1 + integration/class-enable-mastodon-apps.php | 2 +- readme.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 064ac0a2f..9b2c39be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed * Fediverse preview showing `preferredUsername` instead of `name` +* Fixed a potential fatal error in Enable Mastodon Apps ## 4.2.1 - 2024-11-20 diff --git a/integration/class-enable-mastodon-apps.php b/integration/class-enable-mastodon-apps.php index ab1f6431a..a412e4315 100644 --- a/integration/class-enable-mastodon-apps.php +++ b/integration/class-enable-mastodon-apps.php @@ -650,7 +650,7 @@ private static function activity_to_status( $item, $account, $post_id = null ) { $object = $item; } - if ( ! isset( $object['type'] ) || 'Note' !== $object['type'] ) { + if ( ! isset( $object['type'] ) || 'Note' !== $object['type'] || ! $account ) { return null; } diff --git a/readme.txt b/readme.txt index 785a735dd..278fef831 100644 --- a/readme.txt +++ b/readme.txt @@ -141,6 +141,7 @@ For reasons of data protection, it is not possible to see the followers of other * Improved: Outsource Constants to a separate file * Improved: Better handling of `readme.txt` and `README.md` * Fixed: Fediverse preview showing `preferredUsername` instead of `name` +* Fixed: Potential fatal error in Enable Mastodon Apps = 4.2.1 =