From df9c52914d9841e59c982fd18315cbbccd25fb3a Mon Sep 17 00:00:00 2001 From: Alex Soto Date: Thu, 15 Dec 2016 13:01:26 -0600 Subject: [PATCH] [Tests] Avoid NRE in MediaItemTest.DefaultValues test https://bugzilla.xamarin.com/show_bug.cgi?id=49978 MPMediaQuery.Item will be null if Media Library privacy access dialog is not granted --- tests/monotouch-test/MediaPlayer/MediaItemTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/monotouch-test/MediaPlayer/MediaItemTest.cs b/tests/monotouch-test/MediaPlayer/MediaItemTest.cs index 7557dda0ff..02d2be49c7 100644 --- a/tests/monotouch-test/MediaPlayer/MediaItemTest.cs +++ b/tests/monotouch-test/MediaPlayer/MediaItemTest.cs @@ -29,6 +29,8 @@ namespace MonoTouchFixtures.MediaPlayer { using (var q = new MPMediaQuery ()) { var items = q.Items; + if (items == null) + Assert.Inconclusive ("This test needs media library privacy permission to be executed."); if (items.Length == 0) Assert.Inconclusive ("This test needs music in the music library on the device.");