fixed npe if trailers are null