Skip to content

Commit

Permalink
Merge pull request #1208 from byquanton/master
Browse files Browse the repository at this point in the history
Fix a crash if no color is defined for a Caldav Project
  • Loading branch information
alainm23 authored Mar 25, 2024
2 parents ccae3bb + 96631a4 commit 41308cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/Objects/Project.vala
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,11 @@ public class Objects.Project : Objects.BaseObject {
GXml.DomElement propstat = element.get_elements_by_tag_name ("d:propstat").get_element (0);
GXml.DomElement prop = propstat.get_elements_by_tag_name ("d:prop").get_element (0);
name = get_content (prop.get_elements_by_tag_name ("d:displayname").get_element (0));
color = get_content (prop.get_elements_by_tag_name ("x1:calendar-color").get_element (0));

GXml.DomHTMLCollection colorElements = prop.get_elements_by_tag_name ("x1:calendar-color");
if (colorElements.length > 0) {
color = get_content (colorElements.get_element (0));
}

GXml.DomHTMLCollection sync_token_collection = prop.get_elements_by_tag_name ("d:sync-token");
if (update_sync_token && sync_token_collection.length > 0) {
Expand Down

0 comments on commit 41308cb

Please sign in to comment.