Skip to content

Commit

Permalink
no processing if self doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Feb 3, 2017
1 parent 68a2da7 commit 3d0d7da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/FormData/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ public final class Parser {
self.multipart = multipart

self.multipart.onPart = { [weak self] part in
if let contentDisposition = part.headers[.contentDisposition] {
if
let contentDisposition = part.headers[.contentDisposition],
let welf = self
{
let parser = ContentDispositionParser()

var name: String?
Expand All @@ -50,7 +53,7 @@ public final class Parser {

if let name = name {
let field = Field(name: name, filename: filename, part: part)
self?.onField?(field)
welf.onField?(field)
}

}
Expand Down

0 comments on commit 3d0d7da

Please sign in to comment.