From feb498a86f281d82f1d2d1579943079d954baa6e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 6 Nov 2015 17:14:04 +0300 Subject: fix posting without img --- src/main/java/com/juick/http/www/NewMessage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/juick/http') diff --git a/src/main/java/com/juick/http/www/NewMessage.java b/src/main/java/com/juick/http/www/NewMessage.java index d6ef22ee..4d31ee14 100644 --- a/src/main/java/com/juick/http/www/NewMessage.java +++ b/src/main/java/com/juick/http/www/NewMessage.java @@ -170,7 +170,7 @@ public class NewMessage { } String paramImg = request.getParameter("img"); - if (attachmentFName == null && paramImg != null) { + if (attachmentFName == null && paramImg != null && paramImg.length() > 10 ) { try { URL imgUrl = new URL(paramImg); attachmentFName = Utils.downloadImage(imgUrl); @@ -328,7 +328,7 @@ public class NewMessage { } String paramImg = request.getParameter("img"); - if (attachmentFName == null && paramImg != null) { + if (attachmentFName == null && paramImg != null && paramImg.length() > 10) { try { attachmentFName = Utils.downloadImage(new URL(paramImg)); } catch (Exception e) { -- cgit v1.2.3