summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Travelynx/Model/Journeys.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm
index 9330707..750c8b1 100755
--- a/lib/Travelynx/Model/Journeys.pm
+++ b/lib/Travelynx/Model/Journeys.pm
@@ -749,9 +749,9 @@ sub get_months_for_year {
month => $row->{month}
}
)->expand->hash;
- if ($stats) {
- $ret[ $row->{month} - 1 ][2] = $stats->{data};
- }
+
+ # undef -> no journeys for this month; empty hash -> no cached stats
+ $ret[ $row->{month} - 1 ][2] = $stats->{data} // {};
}
}
return @ret;