incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r795345 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme: comet/Timeline.scala lib/AccessPoolMgr.scala
Date Sat, 18 Jul 2009 11:42:42 GMT
Author: vdichev
Date: Sat Jul 18 11:42:42 2009
New Revision: 795345

URL: http://svn.apache.org/viewvc?rev=795345&view=rev
Log:
Handle gracefully messages in timeline which cannot be found.

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala?rev=795345&r1=795344&r2=795345&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/comet/Timeline.scala Sat Jul
18 11:42:42 2009
@@ -59,7 +59,10 @@
   
   def render = {
     val msgMap = Message.findMessages(messages map {_._1})
-    val toDisplay = messages.map(m => (msgMap.get(m._1).get, m._2))
+    val toDisplay =
+      for ((id, reason) <- messages;
+           msg <- msgMap.get(id))
+      yield (msg, reason)
     val jsId = "timeline_messages";
 
     OnLoad(JsCrVar(jsId, JsArray(

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala?rev=795345&r1=795344&r2=795345&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala Sat
Jul 18 11:42:42 2009
@@ -156,7 +156,8 @@
       case xs => bind("pool", in,
                       "user" -> 
                       (lst => xs.flatMap(i => bind("user", lst,
-                                                   "name" -> User.find(i.user).get.nickname.is,
+                                                   "name" -> User.find(i.user).map(
+                                                             _.nickname.is).getOrElse(""),
                                                    "privilege" -> i.permission.is.toString
                       ))))
     }



Mime
View raw message