Fixed error 'Cannot read property name of null' which happened occasiona...

...lly while spawning many concurrent clients (from Node.js) for stress test.
This error happened often when I had 100+ concurrent clients running in Node.js.

Could be a race condition... In any case, we probably shouldn't assume that the transport variable is set since other parts of the code explicitly set it to null under certain conditions.