Handle categories.posts.index == null

If `categories.posts.index` is `null`, it's rendered as `NaN` causing 404 response.