Fix NPE in S3Resource.getName().