Commit 5909266
authored
When screenshotOfViewWithTag: is called on a view that cannot be rendered (e.g. it has a frame of {0,0}, is not currently visible, or the app is in the background), the UIGraphicsImageRenderer may return a valid UIImage object but with a NULL CGImage or empty data.
Attempting to call CGDataProviderCopyData on a null provider, or subsequently CFDataGetLength on a null dataRef, results in a hard crash (typically EXC_BAD_ACCESS or CF_IS_OBJC inside CoreFoundation).
1 parent 1a865ab commit 5909266
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
0 commit comments