If there is no content don't error

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2017-08-07 14:19:41 +02:00
parent 459ae6d94a
commit 9717cdfb9e
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 1 additions and 1 deletions

View File

@ -432,7 +432,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
// 'application/json' must be decoded manually.
if (strpos($this->getHeader('Content-Type'), 'application/json') !== false) {
$params = json_decode(file_get_contents($this->inputStream), true);
if(count($params) > 0) {
if($params !== null && count($params) > 0) {
$this->items['params'] = $params;
if($this->method === 'POST') {
$this->items['post'] = $params;