Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Unexpected object reference not set to an instance of an obj

Thanks for your report.

This bug has been added to the tracker:
https://winscp.net/tracker/1008
ronnieoverby

Unexpected object reference not set to an instance of an obj

I'm seeing this exception in my unit tests after upgrading to the 5.2.1 beta.

System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=WinSCPnet
StackTrace:
at WinSCP.SessionLogReader.Cleanup()
at WinSCP.SessionLogReader.Dispose()
at WinSCP.Session.Cleanup()
at WinSCP.Session.Dispose()
at Winscp.Extensions.Tests.UploadTests.CallingAbortOnUploadThrows() in d:\code\Winscp.Extensions\Winscp.Extensions.Tests\UploadTests.cs:line 164
InnerException:


Here's the failing test:

[Test]
[ExpectedException(typeof (SessionLocalException))]
public void CallingAbortOnUploadThrows()
{
using (var session = OpenSession()) // just a method that return an opened session object
{
Task.Delay(TimeSpan.FromSeconds(5))
.ContinueWith(t => session.Abort());

using (var localFile = new DummyFile(52428800 /* 50mb */))
session.UploadFile(localFile.FileInfo); // this is an extension that calls PutFiles()
}
}