mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2025-01-02 20:12:51 +03:00
Return null if there is no input stream
This commit is contained in:
parent
34242d6451
commit
833b7bad03
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ class EA_Input extends CI_Input
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function json(string $index = null, bool $xss_clean = false)
|
||||
public function json(string $index = null, bool $xss_clean = false): mixed
|
||||
{
|
||||
/** @var EA_Controller $CI */
|
||||
$CI = &get_instance();
|
||||
|
@ -63,7 +63,7 @@ class EA_Input extends CI_Input
|
|||
$input_stream = $CI->input->raw_input_stream;
|
||||
|
||||
if (empty($input_stream)) {
|
||||
throw new RuntimeException('Cannot get JSON attribute from an empty input stream.');
|
||||
return null;
|
||||
}
|
||||
|
||||
$payload = json_decode($input_stream, true);
|
||||
|
|
Loading…
Reference in a new issue