Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #55 from farktronix/NullIteration
Browse files Browse the repository at this point in the history
Don't throw an error when trying to iterate on a null key
  • Loading branch information
tanner0101 authored Apr 25, 2019
2 parents cef9ad9 + fa77763 commit 121ae51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/TemplateKit/Pipeline/TemplateSerializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ public final class TemplateSerializer {
return .data(data)
}
}

guard !data.isNull else {
return Future.map(on: self.container) { .null }
}

guard let data = data.array else {
throw TemplateKitError(
Expand Down

0 comments on commit 121ae51

Please sign in to comment.