Bug fix in DispatchCommon

Corrected null object error handling code around setting visibility of
train ID elements