From: Christos Stathis Date: Wed, 15 Feb 2012 15:31:22 +0000 (+0200) Subject: Add a null pointer check when reading content type X-Git-Tag: v0.8~16 X-Git-Url: https://code.grnet.gr/git/pithos-web-client/commitdiff_plain/2798eb51c449be05cfaca0b4ebb799286ab8e8a8?hp=b9dad860d87ff23c287d6d23ffead4f66683bb6f Add a null pointer check when reading content type --- diff --git a/src/gr/grnet/pithos/web/client/FileList.java b/src/gr/grnet/pithos/web/client/FileList.java index 282f527..f9b4d21 100644 --- a/src/gr/grnet/pithos/web/client/FileList.java +++ b/src/gr/grnet/pithos/web/client/FileList.java @@ -268,7 +268,7 @@ public class FileList extends Composite { public SafeHtml getValue(File object) { SafeHtmlBuilder sb = new SafeHtmlBuilder(); sb.append(Templates.INSTANCE.filenameSpan(object.getName())); - if (object.getContentType().endsWith("png") || object.getContentType().endsWith("gif") || object.getContentType().endsWith("jpeg")) { + if (object.getContentType() != null && (object.getContentType().endsWith("png") || object.getContentType().endsWith("gif") || object.getContentType().endsWith("jpeg"))) { sb.appendHtmlConstant(" ") .append(Templates.INSTANCE.viewLink(app.getApiPath() + object.getOwner() + object.getUri() + "?X-Auth-Token=" + app.getToken(), object.getName())); }