Skip to content

Commit

Permalink
fix decoding empty SettingPreset
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Aug 24, 2017
1 parent f75e7f8 commit 0352ea3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/ProjectSpec/Decoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ extension JSONObjectConvertible {

public init(path: Path) throws {
let content: String = try path.read()
if content == "" {
try self.init(jsonDictionary: [:])
return
}
let yaml = try Yams.load(yaml: content)
guard let jsonDictionary = yaml as? JSONDictionary else {
throw JSONUtilsError.fileNotAJSONDictionary
Expand Down

0 comments on commit 0352ea3

Please sign in to comment.