Fix NPE during location capture