Fix potential NPE when trying to refresh and DB is for not available.