Check to see if a battery is installed before acting

Thanks to noreye for raising the bug over at OSXLatitude