Handle possibly null message from IOException

This commit is contained in:
Andrew Gaul 2014-07-27 19:41:45 -07:00
parent d57bbebe7e
commit 7f31cd6051
1 changed files with 2 additions and 1 deletions

View File

@ -394,7 +394,8 @@ public class LocalAsyncBlobStore extends BaseAsyncBlobStore {
try {
return immediateFuture(storageStrategy.putBlob(containerName, blob));
} catch (IOException e) {
if (e.getMessage().startsWith("MD5 hash code mismatch")) {
String message = e.getMessage();
if (message != null && message.startsWith("MD5 hash code mismatch")) {
HttpResponseException exception = returnResponseException(400);
exception.initCause(e);
throw exception;