Fix empty resource dir crash bug