Fix notice with array_key_exists

```array_key_exists``` throws a notice if the array is null.
Moreover, the test is already included in the ```!empty($type['key'])``` condition.