check null before adding InputStream to entryset

git-svn-id: http://jclouds.googlecode.com/svn/trunk@474 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-05-07 08:07:47 +00:00
parent b0f686c1ef
commit 9837cf89b7
1 changed files with 3 additions and 2 deletions

View File

@ -116,8 +116,9 @@ public class LiveS3InputStreamMap extends BaseS3Map<InputStream> implements
public Set<Map.Entry<String, InputStream>> entrySet() { public Set<Map.Entry<String, InputStream>> entrySet() {
Set<Map.Entry<String, InputStream>> entrySet = new HashSet<Map.Entry<String, InputStream>>(); Set<Map.Entry<String, InputStream>> entrySet = new HashSet<Map.Entry<String, InputStream>>();
for (String key : keySet()) { for (String key : keySet()) {
Map.Entry<String, InputStream> entry = new Entry(key, get(key)); InputStream input = get(key);
entrySet.add(entry); if (input != null)
entrySet.add(new Entry(key, input));
} }
return entrySet; return entrySet;
} }