Maybe just

```php
if (!$file) {
  continue;
}
```