Fix crash in interpretKeyEvents.

cmd.match could return null, but was immediately being indexed. Added a
null check.