Check whether on_screen is null before performing CFBooleanGetValue()

A crash may randomly happen in IsWindowMinimized(), the potential reason is that
|on_screen| is not retrieved from |window| with kCGWindowIsOnScreen property. So
add a == NULL check before executing CFBooleanGetValue().

Bug: chromium:758554
Change-Id: I25ad1ddbb21ec049ef237e55a8d25156bcd982c7
Reviewed-on: https://chromium-review.googlesource.com/634043
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Commit-Queue: Zijie He <zijiehe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#19527}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: c1f691dff2fa7af96fbb51d4cdc83e9e84accdd0
diff --git a/modules/desktop_capture/mac/window_list_utils.cc b/modules/desktop_capture/mac/window_list_utils.cc
index 88b8367..6fc697b 100644
--- a/modules/desktop_capture/mac/window_list_utils.cc
+++ b/modules/desktop_capture/mac/window_list_utils.cc
@@ -141,7 +141,7 @@
 bool IsWindowMinimized(CFDictionaryRef window) {
   CFBooleanRef on_screen = reinterpret_cast<CFBooleanRef>(
       CFDictionaryGetValue(window, kCGWindowIsOnscreen));
-  return !CFBooleanGetValue(on_screen);
+  return on_screen != NULL && !CFBooleanGetValue(on_screen);
 }
 
 // Returns true if the window is minimized.