Bug 940751 - Guard against potentially dereferencing a null pointer. r=botond