From 0bcce449c198a558db24d23e61fd35c415d00f9e Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 30 Jul 2025 18:57:47 +0300 Subject: [PATCH] fix: make `Ajax::$action` property nullable to handle missing POST parameter ## 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