aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/controllers
diff options
context:
space:
mode:
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.java8
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;