@@ -1009,28 +1009,31 @@ void AddSeparator() => AddLabel(new ListLabel
1009
1009
} ) ;
1010
1010
}
1011
1011
1012
- if ( engineBrakeStatus . Contains ( Viewer . Catalog . GetString ( "BC" ) ) )
1012
+ if ( engineBrakeStatus != null )
1013
1013
{
1014
- AddLabel ( new ListLabel
1015
- {
1016
- FirstCol = Viewer . Catalog . GetString ( "Engine brake" ) ,
1017
- LastCol = engineBrakeStatus . Substring ( 0 , engineBrakeStatus . IndexOf ( "BC" ) ) + ColorCode [ Color . Cyan ] ,
1018
- } ) ;
1019
- index = engineBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "BC" ) ) ;
1020
- brakeInfoValue = engineBrakeStatus . Substring ( index , engineBrakeStatus . Length - index ) . TrimEnd ( ) ;
1021
- AddLabel ( new ListLabel
1014
+ if ( engineBrakeStatus . Contains ( Viewer . Catalog . GetString ( "BC" ) ) )
1022
1015
{
1023
- FirstCol = Viewer . Catalog . GetString ( "" ) ,
1024
- LastCol = $ "{ brakeInfoValue } { ColorCode [ Color . White ] } ",
1025
- } ) ;
1026
- }
1027
- else
1028
- {
1029
- AddLabel ( new ListLabel
1016
+ AddLabel ( new ListLabel
1017
+ {
1018
+ FirstCol = Viewer . Catalog . GetString ( "Engine brake" ) ,
1019
+ LastCol = engineBrakeStatus . Substring ( 0 , engineBrakeStatus . IndexOf ( "BC" ) ) + ColorCode [ Color . Cyan ] ,
1020
+ } ) ;
1021
+ index = engineBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "BC" ) ) ;
1022
+ brakeInfoValue = engineBrakeStatus . Substring ( index , engineBrakeStatus . Length - index ) . TrimEnd ( ) ;
1023
+ AddLabel ( new ListLabel
1024
+ {
1025
+ FirstCol = Viewer . Catalog . GetString ( "" ) ,
1026
+ LastCol = $ "{ brakeInfoValue } { ColorCode [ Color . White ] } ",
1027
+ } ) ;
1028
+ }
1029
+ else
1030
1030
{
1031
- FirstCol = Viewer . Catalog . GetString ( "Engine brake" ) ,
1032
- LastCol = $ "{ engineBrakeStatus } { ColorCode [ Color . Cyan ] } ",
1033
- } ) ;
1031
+ AddLabel ( new ListLabel
1032
+ {
1033
+ FirstCol = Viewer . Catalog . GetString ( "Engine brake" ) ,
1034
+ LastCol = $ "{ engineBrakeStatus } { ColorCode [ Color . Cyan ] } ",
1035
+ } ) ;
1036
+ }
1034
1037
}
1035
1038
1036
1039
if ( dynamicBrakeStatus != null && locomotive . IsLeadLocomotive ( ) )
0 commit comments