From 0cdd1165c80c6542927a8470e44346ee0e524085 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 16 Aug 2015 21:23:41 -0700 Subject: Minor improvement of previous patch. --- OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 4b41867..a896897 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -134,11 +134,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog int ch, string[] buttonlabels) { string username = m_scene.UserManagementModule.GetUserName(ownerID); - string ownerFirstName, ownerLastName; + string ownerFirstName, ownerLastName = String.Empty; if (!String.IsNullOrEmpty(username)) { - ownerFirstName = username.Split(' ')[0]; - ownerLastName = username.Split(' ')[1]; + string[] parts = username.Split(' '); + ownerFirstName = parts[0]; + if (parts.Length > 1) + ownerLastName = username.Split(' ')[1]; } else { @@ -172,11 +174,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog int chatChannel, string name, UUID objectid, UUID ownerID) { string username = m_scene.UserManagementModule.GetUserName(ownerID); - string ownerFirstName, ownerLastName; + string ownerFirstName, ownerLastName = String.Empty; if (!String.IsNullOrEmpty(username)) { - ownerFirstName = username.Split(' ')[0]; - ownerLastName = username.Split(' ')[1]; + string[] parts = username.Split(' '); + ownerFirstName = parts[0]; + if (parts.Length > 1) + ownerLastName = username.Split(' ')[1]; } else { -- cgit v1.1