summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-01-03 07:58:15 +0000
committerTed Trask <ttrask01@yahoo.com>2011-01-03 07:58:15 +0000
commit76b7665db82783bd16dd4eddda0707784b186cdc (patch)
tree2285c3d8c68771820ed9e52a94ba2cae7c38ebf3
parent75b5783007e0a189f5207feee70dfb7ba86770ab (diff)
downloadacf-freeswitch-vmail-76b7665db82783bd16dd4eddda0707784b186cdc.tar.bz2
acf-freeswitch-vmail-76b7665db82783bd16dd4eddda0707784b186cdc.tar.xz
Fix exception in listmessages when a user has blank first or last name
-rw-r--r--vmail-listmessages-html.lsp5
1 files changed, 5 insertions, 0 deletions
diff --git a/vmail-listmessages-html.lsp b/vmail-listmessages-html.lsp
index 46bff4d..ddcce6f 100644
--- a/vmail-listmessages-html.lsp
+++ b/vmail-listmessages-html.lsp
@@ -6,6 +6,11 @@ require("viewfunctions")
if viewlibrary.check_permission("listusers") and (viewlibrary.check_permission("forwardmessage") or viewlibrary.check_permission("forwardmymessage")) then
local users = viewlibrary.dispatch_component("listusers", nil, true)
useroptions = {"<option></option>"}
+ for i,v in ipairs(users.value) do
+ v.firstname = v.firstname or ""
+ v.lastname = v.lastname or ""
+ v.username = v.username or ""
+ end
table.sort(users.value, function(a,b) if a.firstname ~= b.firstname then return a.firstname < b.firstname elseif a.lastname ~= b.lastname then return a.lastname < b.lastname else return a.username < b.username end end)
for i,u in ipairs(users.value) do
if u.username ~= session.userinfo.userid then