Fixed a null pointer exception on Gingerbread and previous versions