Skip to content

Commit 23fd32e

Browse files
Make changes to remove VS2015 sematic in test code
1 parent 997269d commit 23fd32e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

test/ODataEndToEnd/Microsoft.OData.Service.Library/DataStoreManager/DefaultDataStoreManager.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,13 @@ public void StopTimer()
147147
private Timer InitTimer()
148148
{
149149
DataStoreTimer = new Timer(_dataStoreLifeTime);
150-
DataStoreTimer.Elapsed += (sender, args) => { _timerTimeoutHandler?.Invoke(this, args); };
150+
DataStoreTimer.Elapsed += (sender, args) =>
151+
{
152+
if (_timerTimeoutHandler != null)
153+
{
154+
_timerTimeoutHandler.Invoke(this, args);
155+
}
156+
};
151157
DataStoreTimer.Start();
152158
return DataStoreTimer;
153159
}

test/ODataEndToEnd/Microsoft.OData.Service.Library/Utils/LibraryUtils.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ public static class LibraryUtils
88
static public string GetSessionId()
99
{
1010
var session = System.Web.HttpContext.Current.Session;
11-
return session?.SessionID;
11+
if (session != null)
12+
{
13+
return session.SessionID;
14+
}
15+
16+
return null;
1217
}
1318
}
1419
}

0 commit comments

Comments
 (0)