Should be:
```
if config and getattr(config, 'ExposedPorts', None):
```
So we can ensure its value is not empty.