"Object reference not set to an instance of an object" When call Show Popup from other popup in the second time

Hello and thank for your product and help:


Xamarin Form: 5.0.0.2125


Syncfution: 19.3.0.45


Platform: Android


1==> I have sfpopup1 defined in mypage.xaml


2==> this sfpopup1 call a custom view its datatemplate :




<sfpopup:PopupView.ContentTemplate>


   <DataTemplate>


          <ContentView>


              <ContentView.Content>


                   <customViews:mycustomView/>


              </ContentView.Content>


          </ContentView>


   </DataTemplate>


 </sfpopup:PopupView.ContentTemplate>


3==> in mycustomView i have a definition of sfpopup2.


 PB scenario :


 when i click for the first time on sfpopup1 it show me the data and i can click to show the second popup2 with success.




 But when i close the popup2 and then i close the popup1, then i click to open the popup1 again, for the second time, i got this error :


 $exception {System.NullReferenceException: Object reference not set to an instance of an object.


  at Syncfusion.XForms.Android.PopupLayout.PopupLayoutDependencyService.Show (System.Object nativeObject, Syncfusion.XForms.PopupLayout.SfPopupLayout formsPopup) [0x00017] in <2a371ae052bd4549be9649e4f0ade4d0>:0


  at Syncfusion.XForms.PopupLayout.SfPopupLayout.Show (System.Boolean isFullScreen) [0x00018] in <452eb09ad7204bdc8957931a3d022370>:0


  at Syncfusion.XForms.PopupLayout.SfPopupLayout.OnIsOpenChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x0007f] in <452eb09ad7204bdc8957931a3d022370>:0


  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:512


  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446


  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00226] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:160


  at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:56


  at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:762


  at Xamarin.Forms.BindingExpression+BindingExpressionPart.PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x000cb] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:773


  at Xamarin.Forms.BindingExpression+WeakPropertyChangedProxy.OnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:666


  NB :


  if i change the call of popup2 by navigation to a new page from the popup1, it works fine.


9 Replies

SV Suja Venkatesan Syncfusion Team October 18, 2021 02:44 PM UTC

Hi Youssef, 

Thank you for contacting Syncfusion support. 

We have checked the reported issue “Exception thrown when call show popup from other popup in the second time” with latest version of Xamarin.forms and SfPopup control, unfortunately we are unable to reproduce the issue in our end. We didn’t get any exception when opening the firstpopup in second time. The Sample we have used to check this case is available in the following link for your reference. 


Please let us know if we missed any customization you have done in your application. Otherwise try to reproduce the reported issue in this sample and revert us with modified sample or Video illustration. It will be more helpful for us to find the exact cause for the issue and prompt solution at earlier  

Regards, 
Suja. 



YO Youssef October 18, 2021 08:58 PM UTC

Hey Guys, thank you for your response.

here you can find your solution modified to reproduce the bug.

the scenario is

1=> click to open the popup1 and then click to open popup2 then click ok to close the timerpickup

and try to do it again from the starting you will see the error


Or just click to open popup1 for the second time and you will see the error.


NB :

the size of allowed attached file (max file size: 30MB) is less than my project zipped, so i just attached the shared project where you can find the modified files and please don't forget to add theses nuggets at the solution level

Syncfusion.Xamarin.SfPicker 19.3.0.45

Syncfusion.Xamarin.SfPopup 19.3.0.45

please let me know if you see the error
Attachment: GettingStarted_aaa7c9b3.zip



SV Suja Venkatesan Syncfusion Team October 19, 2021 02:47 PM UTC

Hi Youssef,  

Sorry for the inconvenience caused.  

We would like to let you know that we are able to reproduce the reported issue in our end. We are currently validating this issue. We will update the further detail on October 21, 2021. We appreciate your patience until then.  

Regards,  
Suja 



SV Suja Venkatesan Syncfusion Team October 21, 2021 02:21 PM UTC

Hi Youssef, 

We deeply regret for the delay. 

We have forwarded this issue to our development team for further analysis. We are in need of two more business days to validate this properly. We will update the further details on or before October 25,2021. We appreciate your patience until then. 

Regards, 
Suja.


SV Suja Venkatesan Syncfusion Team October 25, 2021 03:17 PM UTC

Hi Youssef, 

Thanks for your patience. 

We have checked the reported issue in our end. We have logged a bug report for the reported issue “"Object reference not set to an instance of an object" When call Show Popup from other popup in the second time". We will fix the issue and include the fix in our weekly nuget which is scheduled on November 9,2021. We will let you know once it is released with the fix. We appreciate your patience until then.

You can also track the status of the report from the below link. 
System.NullReferenceException is thrown when open/close the nested Popup view using IsOpen property in Xamarin.Forms | Feedback Portal (syncfusion.com) 

Regards,
Suja. 



SV Suja Venkatesan Syncfusion Team November 30, 2021 03:21 PM UTC

Hi Youssef,  
  
We deeply regret for the inconvenience caused. Due to complexity in fixing the reported issue. We will include the fix in our upcoming 2021 Volume 4 Main release which is expected to be rolled out in the mid of December 2021. We will let you know once it is released with the fix. We appreciate your patience until then.  

Regards, 
Suja. 



SV Suja Venkatesan Syncfusion Team December 22, 2021 06:27 AM UTC

Hi Youssef,


We regret to inform you that due to complexity in fixing the issue, We could not include the fix in our 2021 Volume 4 Main release as promised. We will fix the reported issue and include it in our upcoming weekly nuget release which is planned to roll out on December 28, 2021 we appreciate your patience until then. We will let you know once it gets release with fix.


Regards,

Suja



SV Suja Venkatesan Syncfusion Team December 28, 2021 02:37 PM UTC

Hi Youssef, 

The issue with "Object reference not set to an instance of an object" When call Show Popup from other popup in the second time" has been fixed and the patch for this fix can be downloaded from the following location. 

Recommended approach - exe will perform automatic configuration
Please find the patch setup from below location:
https://syncfusion.com/Installs/support/patch/19.4.0.38/1207186/F169687/SyncfusionPatch_19.4.0.38_1207186_12282021073310623_F169687.exe 

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location:
https://syncfusion.com/Installs/support/patch/19.4.0.38/1207186/F169687/SyncfusionPatch_19.4.0.38_1207186_12282021073310623_F169687.zip 

Please find the patch nuget from below location: 

Assembly Version: 19.4.0.38
Installation Directions :
This patch should replace the files “Syncfusion.SfPopupLayout.XForms” under the following folder.
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\19.4.0.38\precompiledassemblies\19.4.0.38\4.6 

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies. 

Note :
You can change how you receive bug fixes by navigating to the following link and updating your preferences. 


Disclaimer :
Please note that we have created this patch for version 19.4.0.38 specifically to resolve the following issue reported in this Forum only. 

If you have received other patches for the same version for other products, please apply all patches in the order received.
This fix will be included in our upcoming weekly nuget release which is planned to roll out on January 4,2022.  

Regards,
Suja 



SV Suja Venkatesan Syncfusion Team January 5, 2022 07:56 AM UTC

Hi Youssef, 

We have included the fix for the reported issue “Object reference not set to an instance of an object When call Show Popup from other popup in the second time” in our latest weekly nuget release update version 19.4.0.41 which is available for download NuGet Gallery | Home  

Please let us know if you need any other assistance. 

Regards, 
Suja 


Loader.
Up arrow icon