Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for buffer #145

Merged
merged 1 commit into from
Apr 21, 2016
Merged

Check for buffer #145

merged 1 commit into from
Apr 21, 2016

Conversation

onmyway133
Copy link
Contributor

Or this error may show up +[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:] - NULL sample buffer.


guard let imageFromData = UIImage(data: imageData) else { return }
guard error == nil && buffer != nil && CMSampleBufferIsValid(buffer),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

giphy-60

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to check for not nil when you rely on CMSampleBufferIsValid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zenangst just to be sure, because it is implicitly unwrapped optional 😬

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see;

func CMSampleBufferIsValid(_ sbuf: CMSampleBuffer!) -> Boolean

@zenangst zenangst merged commit d6e4b76 into master Apr 21, 2016
@zenangst zenangst deleted the fix/buffer branch April 21, 2016 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants