Subject: I got a NullReferenceException in XmppXElementStreamObserver.Where
Here is logging with call stack:
The first line is line 176:
The program had been running fine for a day or so. I understand this is a prerelease so I understand if the last update for the logging I added broke something. Thanks for any help.
Laters,
SLDR
(Stephen L. De Rudder)
info: EMailIM.Program[0]
SEND:
info: EMailIM.Program[0]
RECV: <message type="chat" id="purplee653b8bd" to="sldr@XXX.XXXXX.com" from="jonesds@XXX.XXXXX.com/4a10bc09"><composing xmlns="http://jabber.org/protocol/chatstates"/></message>
info: EMailIM.Program[0]
RECV: <message type="chat" id="purplee653b8be" to="sldr@XXXXXXXXX.com" from="jonesds@XXXXXXXXX.com/4a10bc09"><active xmlns="http://jabber.org/protocol/chatstates"/><body>ping</body></message>
info: EMailIM.Program[0]
RECV: <message type="chat" id="purplee653b8bf" to="sldr@XXXXXXXXX.com" from="jonesds@XXXXXXXXX.com/4a10bc09"><active xmlns="http://jabber.org/protocol/chatstates"/></message>
warn: DotNetty.Transport.Channels.DefaultChannelPipeline[0]
An ExceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
System.NullReferenceException: Object reference not set to an instance of an object.
at EMailIM.Program.<>c.<SetupSubscribes>b__11_0(XmppXElement el) in C:\Users\derudder\Documents\Visual Studio 2017\Projects\EMailIMPreRelease\Program.cs:line 176
at System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reactive.Stubs.<>c.<.cctor>b__2_1(Exception ex)
at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
at System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
at System.Reactive.Observer`1.OnNext(T value)
at Matrix.Network.Handlers.XmppStreamEventHandler.ChannelRead0(IChannelHandlerContext ctx, XmlStreamEvent msg)
at DotNetty.Transport.Channels.SimpleChannelInboundHandler`1.ChannelRead(IChannelHandlerContext ctx, Object msg)
at DotNetty.Transport.Channels.AbstractChannelHandlerContext.InvokeChannelRead(Object msg)
info: EMailIM.Program[0]
SEND:
SEND:
info: EMailIM.Program[0]
RECV: <message type="chat" id="purplee653b8bd" to="sldr@XXX.XXXXX.com" from="jonesds@XXX.XXXXX.com/4a10bc09"><composing xmlns="http://jabber.org/protocol/chatstates"/></message>
info: EMailIM.Program[0]
RECV: <message type="chat" id="purplee653b8be" to="sldr@XXXXXXXXX.com" from="jonesds@XXXXXXXXX.com/4a10bc09"><active xmlns="http://jabber.org/protocol/chatstates"/><body>ping</body></message>
info: EMailIM.Program[0]
RECV: <message type="chat" id="purplee653b8bf" to="sldr@XXXXXXXXX.com" from="jonesds@XXXXXXXXX.com/4a10bc09"><active xmlns="http://jabber.org/protocol/chatstates"/></message>
warn: DotNetty.Transport.Channels.DefaultChannelPipeline[0]
An ExceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
System.NullReferenceException: Object reference not set to an instance of an object.
at EMailIM.Program.<>c.<SetupSubscribes>b__11_0(XmppXElement el) in C:\Users\derudder\Documents\Visual Studio 2017\Projects\EMailIMPreRelease\Program.cs:line 176
at System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Reactive.Stubs.<>c.<.cctor>b__2_1(Exception ex)
at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
at System.Reactive.Linq.ObservableImpl.Where`1._.OnNext(TSource value)
at System.Reactive.Observer`1.OnNext(T value)
at Matrix.Network.Handlers.XmppStreamEventHandler.ChannelRead0(IChannelHandlerContext ctx, XmlStreamEvent msg)
at DotNetty.Transport.Channels.SimpleChannelInboundHandler`1.ChannelRead(IChannelHandlerContext ctx, Object msg)
at DotNetty.Transport.Channels.AbstractChannelHandlerContext.InvokeChannelRead(Object msg)
info: EMailIM.Program[0]
SEND:
The first line is line 176:
- x.XmppXElementStreamObserver.Where(el => el.OfType<Message>() && el.Cast<Message>().Chatstate == Chatstate.Active && el.Cast<Message>().Body.Length > 0).Subscribe(el =>
- {
- Message m = el.Cast<Message>();
- Log("Message:", el.ToString());
- SendEMail(m.From, m.Body);
- });
The program had been running fine for a day or so. I understand this is a prerelease so I understand if the last update for the logging I added broke something. Thanks for any help.
Laters,
SLDR
(Stephen L. De Rudder)