Update this to:
```
if (!is_scalar($value) || null === $value) {
```
to preserve the original behavior.