Fix javascript error while loading a page with no categories

Bug: T84847
Change-Id: I68b78f38e547a51e7766cb337ea9d8ef3104415b