- if key == "enabled_sources" {
- configuration[key] = value as! [String]
- }
- else {
- configuration[key] = value as! String
+ if key == "enabled_sources" {
+ if let value = value as? [String] {
+ configuration[key] = value
+ }
+ } else {
+ if let value = value as? String {
+ configuration[key] = value
+ }
+ }