Do not crash on invalid declaration.

BUG: 339822