It's ok to delete null, so need need to check for null:

```
      delete lpEntry;
```