                         "timetostart": time,
                         "profilename": profilename,
                     ]
-                    self.expandedData!.append(dict)
+                    self.expandedData?.append(dict)
                 case Scheduletype.daily.rawValue:
                     self.daily(dateStart: dateStart, schedule: schedule, dict: dict)
                 case Scheduletype.weekly.rawValue:

//  Created by Thomas Evensen on 05/09/2016.
//  Copyright © 2016 Thomas Evensen. All rights reserved.
//
// swiftlint:disable line_length trailing_comma

import Cocoa
import Foundation

                    break
                }
            }
            guard (self.expandedData?.count ?? 0) > 0 else { return }
            self.sortedschedules = self.expandedData?.sorted { (date1, date2) -> Bool in
                if let date1 = date1.value(forKey: "start") as? Date {
                    if let date2 = date2.value(forKey: "start") as? Date {
