Fix NPE in ResourceLocator