aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/views
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-11-09 15:34:18 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-09 21:22:41 +0000
commit072a198656b80f8f713aaa8d917436a58190e439 (patch)
tree16116e8f955603c4b143427cac47b7eb4fdd0b73 /src/views
parent8887ffa01ecf6cba397a267fd463aca3d977e5b2 (diff)
Fix implicit nullability cast of [NSScreen mainScreen].
Without this patch I get this warning-as-error with XCode 8.1 (8B62): ../src/views/mac/SkOSWindow_Mac.mm:88:43: error: implicit conversion from nullable pointer 'NSScreen * _Nullable' to non-nullable pointer type 'NSScreen * _Nonnull' [-Werror,-Wnullable-to-nonnull-conversion] [(SkNSView*)fHWND enterFullScreenMode:[NSScreen mainScreen] withOptions:nil]; Seems like the thing to do is explicitly null check [NSScreen mainScreen] before calling enterFullScreenMode? (google.com/images?q=i+have+no+idea+what+i+am+doing) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4631 Change-Id: I20c4a2b559a347a6a128479b81cb515692832e72 Reviewed-on: https://skia-review.googlesource.com/4631 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/views')
-rw-r--r--src/views/mac/SkOSWindow_Mac.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/views/mac/SkOSWindow_Mac.mm b/src/views/mac/SkOSWindow_Mac.mm
index 4efa7533b4..a256b39fa3 100644
--- a/src/views/mac/SkOSWindow_Mac.mm
+++ b/src/views/mac/SkOSWindow_Mac.mm
@@ -85,7 +85,10 @@ void SkOSWindow::setVsync(bool enable) {
}
bool SkOSWindow::makeFullscreen() {
- [(SkNSView*)fHWND enterFullScreenMode:[NSScreen mainScreen] withOptions:nil];
+ NSScreen* _Nullable screen = [NSScreen mainScreen];
+ if (screen) {
+ [(SkNSView*)fHWND enterFullScreenMode:(NSScreen* _Nonnull)screen withOptions:nil];
+ }
return true;
}