From efd85eef4ad69e5b53be3f3d0ea75d267d0b664c Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 30 Jul 2025 18:59:02 +0300 Subject: [PATCH] fix: Make `Ajax::$action` property nullable to handle missing POST parameter (#2066) ## Problem When calling ajax.php without passing the 'action' parameter, PHP throws a TypeError: `Cannot assign null to property TorrentPier\Ajax::$action of type string` ## Solution Changed the `$action` property type from `string` to `?string` to allow null values when the POST parameter is not provided. ## Changes - Changed `public string $action;` to `public ?string $action;` --- src/Ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ajax.php b/src/Ajax.php index a2f3e6090..c123ea4fe 100644 --- a/src/Ajax.php +++ b/src/Ajax.php @@ -50,7 +50,7 @@ class Ajax 'index_data' => ['guest'], ]; - public string $action; + public ?string $action; /** * Constructor