Skip to content

Commit

Permalink
Check that size is above zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoffer Winterkvist committed Nov 8, 2016
1 parent 7319259 commit c8933ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Mac/NSImage+Hue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class CountedColor {
extension NSImage {

fileprivate func resize(_ newSize: CGSize) -> NSImage {
guard newSize.width > 0.0 && newSize.height > 0.0 else { return NSImage() }

let scaledImage = NSImage(size: newSize)
scaledImage.lockFocus()
let ctx = NSGraphicsContext.current()
Expand Down

0 comments on commit c8933ab

Please sign in to comment.