Fix implicit nullability cast of [NSScreen mainScreen].
authorMike Klein <mtklein@chromium.org>
Wed, 9 Nov 2016 20:34:18 +0000 (15:34 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 9 Nov 2016 21:22:41 +0000 (21:22 +0000)
commit072a198656b80f8f713aaa8d917436a58190e439
tree16116e8f955603c4b143427cac47b7eb4fdd0b73
parent8887ffa01ecf6cba397a267fd463aca3d977e5b2
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>
src/views/mac/SkOSWindow_Mac.mm