We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb70c8a commit e07b1a9Copy full SHA for e07b1a9
src/NetMQ/NetMQRuntime.cs
@@ -36,7 +36,14 @@ public NetMQRuntime()
36
/// </summary>
37
public static NetMQRuntime Current
38
{
39
- get { return s_current.Value!; }
+ get
40
+ {
41
+ var result = s_current.Value;
42
+ if (result == null)
43
+ throw new InvalidOperationException("NetMQRuntime.Current is not available on this thread. Ensure that a NetMQRuntime has been created.");
44
+ else
45
+ return result;
46
+ }
47
}
48
49
internal static NetMQPoller Poller
@@ -52,7 +59,7 @@ public void Run(params Task[] tasks)
52
59
53
60
Run(CancellationToken.None, tasks);
54
61
55
-
62
+
56
63
internal void Add(NetMQSocket socket)
57
64
58
65
m_poller.Add(socket);
0 commit comments