diff options
author | Vitaly Takmazov | 2016-12-08 16:14:34 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-08 16:59:04 +0300 |
commit | 34f9a7dad5535870486edb304ee8043381f7cbdd (patch) | |
tree | 1c5d903f92d7383d2a6700947e64d976a68c0cd1 /juick-api/src/main/java/com/juick/api/controllers | |
parent | 7e954500ee1b68ad07e2b0bda4eb549ee99167b4 (diff) |
juick-api: fix upload
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/controllers')
-rw-r--r-- | juick-api/src/main/java/com/juick/api/controllers/Post.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Post.java b/juick-api/src/main/java/com/juick/api/controllers/Post.java index 9749d700..40c6207e 100644 --- a/juick-api/src/main/java/com/juick/api/controllers/Post.java +++ b/juick-api/src/main/java/com/juick/api/controllers/Post.java @@ -111,7 +111,7 @@ public class Post { } } - String attachmentType = attachmentFName != null ? attachmentFName.substring(attachmentFName.length() - 3) : null; + String attachmentType = StringUtils.isNotEmpty(attachmentFName) ? attachmentFName.substring(attachmentFName.length() - 3) : null; int mid = messagesService.createMessage(vuid, body, attachmentType, tagsList); subscriptionService.subscribeMessage(mid, vuid); com.juick.Message jmsg = messagesService.getMessage(mid); @@ -124,7 +124,7 @@ public class Post { xmsg.addExtension(jmsg); xmsg.addExtension(new Nickname("@" + jmsg.getUser().getName())); - if (attachmentFName != null) { + if (StringUtils.isNotEmpty(attachmentFName)) { String fname = mid + "." + attachmentType; String attachmentURL = "http://i.juick.com/photos-1024/" + fname; @@ -227,7 +227,7 @@ public class Post { } } - String attachmentType = attachmentFName != null ? attachmentFName.substring(attachmentFName.length() - 3) : null; + String attachmentType = StringUtils.isNotEmpty(attachmentFName) ? attachmentFName.substring(attachmentFName.length() - 3) : null; int ridnew = messagesService.createReply(mid, rid, vuid, body, attachmentType); subscriptionService.subscribeMessage(mid, vuid); @@ -247,7 +247,7 @@ public class Post { xmsg.addExtension(new Nickname("@" + jmsg.getUser().getName())); - if (attachmentFName != null) { + if (StringUtils.isNotEmpty(attachmentFName)) { String fname = mid + "-" + ridnew + "." + attachmentType; String attachmentURL = "http://i.juick.com/photos-1024/" + fname; |