Skip to content

Commit 1dce947

Browse files
committed
Omit blank GEO properties on EventInstances
1 parent fc80233 commit 1dce947

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

redical_core/src/event_instance.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use redical_ical::{
1717
properties::{
1818
ICalendarProperty,
1919
ICalendarDateTimeProperty,
20+
ICalendarGeoProperty,
2021
CategoriesProperty,
2122
LocationTypeProperty,
2223
ClassProperty,
@@ -108,8 +109,12 @@ impl EventInstance {
108109
event_occurrence_override: Option<&EventOccurrenceOverride>,
109110
) -> Option<GeoProperty> {
110111
if let Some(event_occurrence_override) = event_occurrence_override {
111-
if event_occurrence_override.indexed_properties.geo.is_some() {
112-
return event_occurrence_override.indexed_properties.geo.to_owned();
112+
if let Some(overridden_geo_property) = event_occurrence_override.indexed_properties.geo.as_ref() {
113+
if overridden_geo_property.is_present() {
114+
return Some(overridden_geo_property.to_owned());
115+
} else {
116+
return None;
117+
}
113118
}
114119
}
115120

tests/integration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ mod integration {
908908
"RELATED-TO;RELTYPE=PARENT:PARENT_UID",
909909
"CATEGORIES:CATEGORY_ONE,OVERRIDDEN_CATEGORY", // <= Overridden
910910
"LOCATION-TYPE:X-KEY=VALUE:LOCATION_TYPE",
911-
"GEO:;", // <= Overridden
911+
// "GEO:;", // <= Overridden (removed from EventInstance because blank)
912912
"X-SPACES-BOOKED:12", // <= Overridden
913913
],
914914
],
@@ -1160,7 +1160,7 @@ mod integration {
11601160
"DTEND:20210105T190000Z",
11611161
"DTSTART:20210105T183000Z",
11621162
"DURATION:PT30M",
1163-
"GEO:;",
1163+
// "GEO:;", <= Overridden (removed from EventInstance because blank)
11641164
"RECURRENCE-ID;VALUE=DATE-TIME:20210105T183000Z",
11651165
"RELATED-TO;RELTYPE=PARENT:PARENT_UID_OVERRIDE",
11661166
"SUMMARY:Overridden Event in Bristol on Tuesdays and Thursdays at 6:30PM (running online)",

0 commit comments

Comments
 (0)