Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Null Reference Exception

$
0
0

So right around I was trying to make me a new Xamarin.Forms application, somehow to following code runs fine in 1.0, until 1.2
...
SetPage (App.GetMainPage ());
In 1.2, the debugger reported that the SetPage was passing a null object, leading to the throwing of a NullReferenceException, then I was confused, I don't think that it will pass a null object, So I have make a null check for the Main Page:
var obj = App.GetMainPage ();
if (obj != null)
SetPage (obj);
Somehow the exception still exist, but this will run fine if I was using the original 1.0 version of Xamarin.Forms, now, I'm waiting for 1.2.2 version of Xamarin.Forms to see that if the error would likely scatter away.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>