Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
prevent null pointer exception when file types are not specified for …
Browse files Browse the repository at this point in the history
…raw push command
  • Loading branch information
davidmason committed Feb 12, 2013
1 parent 64947e2 commit 293894a
Showing 1 changed file with 10 additions and 7 deletions.
Expand Up @@ -113,15 +113,18 @@ public void run() throws Exception

ClientResponse<String> response = fileResource.acceptedFileTypes();
StringSet serverAcceptedTypes = new StringSet(response.getEntity());
for (String type : getOpts().getFileTypes())
if (getOpts().getFileTypes() != null)
{
if (serverAcceptedTypes.contains(type))
for (String type : getOpts().getFileTypes())
{
types.add(type);
}
else
{
log.warn("Requested type '{}' is not supported by the target server and will be ignored.", type);
if (serverAcceptedTypes.contains(type))
{
types.add(type);
}
else
{
log.warn("Requested type '{}' is not supported by the target server and will be ignored.", type);
}
}
}

Expand Down

0 comments on commit 293894a

Please sign in to comment.