Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix exception on short urls.

git-svn-id: https://svn.apache.org/repos/asf/incubator/esme/trunk@1022916 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 3c349b495979db4efea8c090a73f71a7f2f1d12c 1 parent 37efc5a
Vassil Dichev authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 server/src/main/scala/org/apache/esme/model/Message.scala
View
7 server/src/main/scala/org/apache/esme/model/Message.scala
@@ -401,7 +401,12 @@ class Message extends LongKeyedMapper[Message] with ManyToMany {
url.toString
else
"/u/" + id
- <xml:group> <a class="tiplelement" href={href} target="_blank" title={url}>{url.toString.substring(0,20)}...</a> </xml:group>
+ def truncateUrl(urlString: String, len: Int) =
+ if (urlString.length <= len)
+ urlString
+ else
+ urlString.substring(0, len - 3) + "..."
+ <xml:group> <a class="tiplelement" href={href} target="_blank" title={url}>{truncateUrl(url.toString, 20)}</a> </xml:group>
}
).getOrElse(Text("") )

0 comments on commit 3c349b4

Please sign in to comment.
Something went wrong with that request. Please try again.