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

stopfinder: handle edge case with just a single result.

parent c1b672c6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -572,6 +572,15 @@ sub results_stopfinder {
	my $json = $self->{response};

	my @results;

	# Edge case: there is just a single result.
	# Oh EFA, you so silly.
	if ( ref( $json->{stopFinder}{points} ) eq 'HASH'
		and exists $json->{stopFinder}{points}{point} )
	{
		$json->{stopFinder}{points} = [ $json->{stopFinder}{points}{point} ];
	}

	for my $stop ( @{ $json->{stopFinder}{points} // [] } ) {
		push(
			@results,