Properly handle no posts

fixes #4058
- Remove unneeded code

---

@novaugust Was there any reason you introduced this code?