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;`
This commit is contained in:
Roman Kelesidis 2025-07-30 18:57:47 +03:00
commit 0bcce449c1
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4

View file

@ -50,7 +50,7 @@ class Ajax
'index_data' => ['guest'],
];
public string $action;
public ?string $action;
/**
* Constructor