Avoid undefined property calories

This commit is contained in:
Justin Foell
2021-09-24 13:33:36 -05:00
parent 37a1a1fdce
commit ade4debd7c
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -4,7 +4,7 @@ Contributors: cmanon, jrfoell, lancewillett, dlintott, sebastianerb
Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, paddle, kayak, gps, shortcode, widget, plugin, block, blocks
Requires at least: 4.6
Tested up to: 5.8
Stable tag: 2.9.1
Stable tag: 2.9.2
Requires PHP: 5.3
License: GPLv2 or later
@@ -135,11 +135,14 @@ On the WP-Strava settings page you cannot currently remove and add another athle
== Changelog ==
= 2.9.2 =
Add ability to paste Activity/Route/Segment URL into the block editor
Add ability to paste Activity/Route/Segment URL into the block editor and have it insert the appropriate block https://wordpress.org/support/topic/sorry-this-content-could-not-be-embedded-5/
Add `reduce_polyline()` for maps with large polylines but no summary provided (prevents empty map) https://wordpress.org/support/topic/map-embed-from-segment-shows-default-map/
= 2.9.1 =
Add conditional to look for zero/null/empty activity time to avoid exception https://wordpress.org/support/topic/exception-thrown-oceanwp-theme/
= 2.9.0 =
Added Segment Block https://wordpress.org/support/topic/show-segments-feature/ / https://wordpress.org/support/topic/embed-segments-feature/
Switched Activities List to display moving time instead of elapsed time https://wordpress.org/support/topic/moving-time-instead-of-elapsed-time/
+1 -1
View File
@@ -83,7 +83,7 @@ class WPStrava_ActivitiesListRenderer {
$response .= sprintf( __( ' climbing %1$s %2$s', 'wp-strava' ), $som->elevation( $activity->total_elevation_gain ), $som->get_elevation_label() );
}
if ( $activity->calories ) {
if ( ! empty( $activity->calories ) ) { // LOL - empty calories :^)
// Translators: "burning 200 calories."
$response .= sprintf( __( ' burning %1$s calories.', 'wp-strava' ), $som->calories( $activity->calories ) );
}