             endDateTimeString = String(endDateTimeStringPointer ?? "")
             endDateTimeString = endDateTimeString.replacingOccurrences(of: String(format: "DTEND;TZID=%@:", timezoneIDString), with: "").replacingOccurrences(of: "\r", with: "")
 
-            if startDateTimeString == "" {
+            if endDateTimeString.isEmpty {
                 eventScanner = Scanner(string: event)
                 eventScanner.scanUpTo("DTEND:", into: nil)
                 eventScanner.scanUpTo("\n", into: &endDateTimeStringPointer)
                 endDateTimeString = String(endDateTimeStringPointer ?? "")
                 endDateTimeString = endDateTimeString.replacingOccurrences(of: "DTEND:", with: "").replacingOccurrences(of: "\r", with: "")
 
-                if startDateTimeString == "" {
+                if endDateTimeString.isEmpty {
                     eventScanner = Scanner(string: event)
                     eventScanner.scanUpTo("DTEND;VALUE=DATE:", into: nil)
                     eventScanner.scanUpTo("\n", into: &endDateTimeStringPointer)

                if eventScanner.scanUpTo("ATTENDEE;", into: nil) {
                    scannerStatus = eventScanner.scanUpTo("\n", into: &attendeeStringPointer)
                    attendeeString = String(attendeeStringPointer ?? "")
                    if scannerStatus, attendeeString != "" {
                        attendeeString = attendeeString.replacingOccurrences(of: "ATTENDEE;", with: "").replacingOccurrences(of: "\r", with: "")
                        if let attendee = createAttendee(string: attendeeString) {
                            attendees.append(attendee)

            timezoneIDString = String(timezoneIDStringPointer ?? "")
            timezoneIDString = timezoneIDString.replacingOccurrences(of: "DTSTART;TZID=", with: "").replacingOccurrences(of: "\n", with: "")

            if timezoneIDString.isEmpty {
                // Extract event time zone ID
                eventScanner = Scanner(string: event)
                eventScanner.scanUpTo("TZID:", into: nil)
