add null check for transport

transport will be null if !WorkerRunsOnThisEndpoint