I'm getting an error Class name must be a valid object or a string from /system/ee/ExpressionEngine/Addons/pro/Model/Dashboard/DashboardWidget.php:172 when trying to view my dashboard (/admin.php?/cp/homepage) in the CP as a non-superadmin. For some reason, it works fine as a superadmin.
I have a 3rd party add-on (Publisher) and 2 of its Widgets installed and configured on my dashboard (pending_approvals and recent_edits, though I don't believe the bug has to do with Publisher directly):

The issue appears to be because $addon is referenced, but is sometimes null because it's being set in the conditional.
This diff seems to fix it by using $this->_addon everywhere instead of $addon.

Tested on EE 6.2.2
I'm getting an error
Class name must be a valid object or a stringfrom/system/ee/ExpressionEngine/Addons/pro/Model/Dashboard/DashboardWidget.php:172when trying to view my dashboard (/admin.php?/cp/homepage) in the CP as a non-superadmin. For some reason, it works fine as a superadmin.I have a 3rd party add-on (Publisher) and 2 of its Widgets installed and configured on my dashboard (
pending_approvalsandrecent_edits, though I don't believe the bug has to do with Publisher directly):The issue appears to be because
$addonis referenced, but is sometimes null because it's being set in the conditional.This diff seems to fix it by using
$this->_addoneverywhere instead of$addon.Tested on EE 6.2.2