B2017-247 Added Error Handling for PingSession so that the code will not crash

This commit is contained in:
Rich 2017-11-06 16:47:41 +00:00
parent 95ae4efc58
commit 94bf1c70a4

View File

@ -125,14 +125,22 @@ namespace VEPROMS.CSLA.Library
}
public List<int> PingSession()
{
List<int> myList = new List<int>();
SessionPing.Execute(this.SessionID);
ChangedContents = SessionChangedContents.Execute(this.LastContentChange);
ChangedItems = SessionChangedItems.Execute(this.LastContentChange);
OwnerInfoList oil = OwnerInfoList.GetBySessionID(this.SessionID);
foreach (OwnerInfo oi in oil)
myList.Add(oi.OwnerID);
return myList;
// B2017-247 Add Error handler for PingSession
try
{
List<int> myList = new List<int>();
SessionPing.Execute(this.SessionID);
ChangedContents = SessionChangedContents.Execute(this.LastContentChange);
ChangedItems = SessionChangedItems.Execute(this.LastContentChange);
OwnerInfoList oil = OwnerInfoList.GetBySessionID(this.SessionID);
foreach (OwnerInfo oi in oil)
myList.Add(oi.OwnerID);
return myList;
}
catch (Exception)
{
return null;
}
}
public void EndSession()
{