fixed a potential NPE
Be compatible to Luna