Skip to content

Commit

Permalink
Bring back "write fail" workaround
Browse files Browse the repository at this point in the history
It now only happens if you cancel close to the end.
  • Loading branch information
sindresorhus committed Jan 29, 2019
1 parent 5e5aee2 commit 074bf8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Gifski/Gifski.swift
Expand Up @@ -145,6 +145,13 @@ final class Gifski {
try g.write(path: conversion.output.path)
completionHandlerOnce?(nil)
} catch {
// TODO: Figure out how to not get a write error when the process was simply cancelled.
// To reproduce, remove the guard-statement, and try cancelling at 80-95%.
guard !progress.isCancelled else {
completionHandlerOnce?(.cancelled)
return
}

completionHandlerOnce?(.writeFailed(error as! GifskiWrapperError))
}
}
Expand Down

0 comments on commit 074bf8c

Please sign in to comment.