I am developing on a project in xamarin and I've encountered a roadblock. After trying to open a form with a button , all the lines of code work properly and none of the variables are null , but after the final line of the code which is an async await method, the program throws me an null reference error from exceptioncommonservice.cs and the whole app shuts down. Here is all the code that has a play in this problem : Button code , Form constructor (to note, i've inserted all the code but most of it is irrelevant to the problem and i've checked for null variables and there seem to be none, but I may have overseen something) , The loadEveniment function which i think is the problem in the constructor. If someone has any idea of the problem here, I would be grateful for some advice as I'm yet a junior and not quite familiar with xamarin and mobile dev.
private async Task openEveniment(string IDEvent, bool evenimentNou)
{
try
{
ContentPage pagina;
if (PaginaDeschisaDin == "atasareplanificare" && evenimentNou == true)
{
pagina = new Calendar.DayView.DetaliuEveniment(Convert.ToInt64(IDEvent), evenimentNou,true, planificareDeAtasat,false,IDClientTicketing,NumeClientTicketing,IDTicket);
}
else
{
pagina = new Calendar.DayView.DetaliuEveniment(Convert.ToInt64(IDEvent), evenimentNou,false,null,false, IDClientTicketing, NumeClientTicketing, IDTicket);
}
(pagina as DetaliuEveniment).parinte = this;
NavigationPage.SetHasNavigationBar(pagina, false);
await Navigation.PushModalAsync(pagina); //null reference from exceptionservicecommon.cs
}
I've checked the variables and lists for nulls but didn't quite find one. Also the call stack didn't prove to help at all.