Fixed GPS bug

I fixed a GPS bug regarding null pointers