Getting NPE while delete a type in index

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:

```
CODE
```

I edited your post but please do it next time.

What is the content of deleteByQuery object?
Any chance that client is null?