[Mercurial] Possible NPE, code style.