Unverified Commit 407c2a34 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

hafas: handle undefined message components

parent 42e9b67f
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -273,7 +273,12 @@ sub format_delay {

sub show_message {
	my ($msg) = @_;
	if ( $verbosity >= ( $min_verbosity{ $msg->type } // 0 ) ) {
	if (
		$msg->text
		and ( not $msg->type
			or $verbosity >= ( $min_verbosity{ $msg->type } // 0 ) )
	  )
	{
		if ( $msg->short ) {
			printf( "| %s\n", $msg->short );
		}
@@ -451,9 +456,13 @@ for my $res ( $hafas->connections ) {
			printf("\n???\n");
		}
		for my $msg ( $sec->messages ) {
			if ( $msg->code eq 'text.connection.section.arrival.date.deviation'
			if (
				$msg->code
				and ( $msg->code eq
					'text.connection.section.arrival.date.deviation'
					or $msg->code eq
					'text.connection.section.departure.date.deviation' )
			  )
			{
				next;
			}