Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make gd:when conditional

  • Loading branch information...
commit 284b8c67af8d51d55b4de4c849ca8f7eb00fd415 1 parent 8881f8c
@btucker btucker authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/google/event.rb
View
6 lib/google/event.rb
@@ -133,8 +133,10 @@ def self.new_from_xml(xml, calendar) #:nodoc:
title = xml.at_xpath("xmlns:title").content
content = xml.at_xpath("xmlns:content").content
where = xml.at_xpath("gd:where")['valueString']
- start_time = xml.at_xpath("gd:when")['startTime']
- end_time = xml.at_xpath("gd:when")['endTime']
+ if xml.at_xpath("gd:when") # there are situations where gd:when appears to be nil
+ start_time = xml.at_xpath("gd:when")['startTime']
+ end_time = xml.at_xpath("gd:when")['endTime']
+ end
quickadd = xml.at_xpath("gCal:quickadd") ? xml.at_xpath("gCal:quickadd")['quickadd'] : nil
Event.new(:id => id,
Please sign in to comment.
Something went wrong with that request. Please try again.