Avoid LINQ exception (#5933)
authorMorten Nielsen <1378165+dotMorten@users.noreply.github.com>
Tue, 23 Apr 2019 17:18:19 +0000 (10:18 -0700)
committerShane Neuville <shane94@hotmail.com>
Tue, 23 Apr 2019 17:18:19 +0000 (11:18 -0600)
commitcbf2d089fa076c62185ade1db631c94e0c24685b
treea4d9cb4ce497e39b43b2435140eac310ff0fc3c5
parente26d22d77c7bf00a5a13f4994313c0a67d03398b
Avoid LINQ exception (#5933)

* Avoid LINQ exception

If the back button in UWP is pressed, but there's nothing in the backstack, the `Last()` LINQ query will throw `System.InvalidOperationException: 'Sequence contains no elements`
This change avoids that, and just returns false that Forms didn't handle the event.

* Change to use LastOrDefault
Xamarin.Forms.Platform.UAP/Platform.cs