I ended up writing a horrible “find next month” chunk of code with the actual set of months with entries in it, so it not only doesn’t link to broken pages, but it entirely skips months without entries. Not ideal, especially since the month pages are still broken if you navigate there directly, but it works.