summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Travel/Status/DE/IRIS.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index 056fef4..5674d61 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -354,7 +354,9 @@ sub get_realtime {
my $result = $self->{departure_by_id}{$id};
- if ( not $result ) {
+ # add_result will return nothing if no ./tl node is present. The ./tl
+ # check here is for optimization purposes.
+ if ( not $result and ( $s->findnodes('./tl') )[0] ) {
$result = $self->add_result( $station, $s );
if ($result) {
$result->set_unscheduled(1);