Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when Close Viewmodel With Result using MasterDetail #2757

Closed
1 task done
juanagu opened this issue Apr 3, 2018 · 1 comment
Closed
1 task done

Crash when Close Viewmodel With Result using MasterDetail #2757

juanagu opened this issue Apr 3, 2018 · 1 comment
Labels
p/forms Xamarin.Forms platform t/bug Bug type
Milestone

Comments

@juanagu
Copy link

juanagu commented Apr 3, 2018

Sample repository: https://github.com/juanagu/MvvmCross/tree/master

I Added:
ViewModel : MixedNavResultDetailViewModel
Page: MixedNavResultDetailPage

Steps to reproduce 📜

  1. Run Playground.Forms.iOS or Playground.Forms.Android

  2. Open Show Mixed Navigation

  3. Click Login

  4. In Menu Drawer selected "Result" option.

  5. Click "Cerrar"

Expected behavior 🤔

Close viewmodel and return Result

Actual behavior 🐛

Application Crash:

System.NullReferenceException: Object reference not set to an instance of an object
  at MvvmCross.Forms.Views.MvxFormsPagePresenter.CloseMasterDetailPage (MvvmCross.Core.ViewModels.IMvxViewModel viewModel, MvvmCross.Forms.Views.Attributes.MvxMasterDetailPagePresentationAttribute attribute) [0x0004b] in /Users/jagu/Projects/GitHub/MvvmCross/MvvmCross-Forms/MvvmCross.Forms/Views/MvxFormsPagePresenter.cs:438 
  at MvvmCross.Forms.Views.MvxFormsPagePresenter.<RegisterAttributeTypes>b__19_5 (MvvmCross.Core.ViewModels.IMvxViewModel viewModel, MvvmCross.Core.Views.MvxBasePresentationAttribute attribute) [0x00000] in /Users/jagu/Projects/GitHub/MvvmCross/MvvmCross-Forms/MvvmCross.Forms/Views/MvxFormsPagePresenter.cs:126 
  at MvvmCross.Core.Views.MvxAttributeViewPresenter.Close (MvvmCross.Core.ViewModels.IMvxViewModel viewModel) [0x00057] in /Users/jagu/Projects/GitHub/MvvmCross/MvvmCross/Core/Core/Views/MvxAttributeViewPresenter.cs:183 
  at MvvmCross.Core.Views.MvxAttributeViewPresenter.ChangePresentation (MvvmCross.Core.ViewModels.MvxPresentationHint hint) [0x0001e] in /Users/jagu/Projects/GitHub/MvvmCross/MvvmCross/Core/Core/Views/MvxAttributeViewPresenter.cs:162 
  at MvvmCross.Forms.Views.MvxFormsPagePresenter.<>n__0 (MvvmCross.Core.ViewModels.MvxPresentationHint hint) <0x130e27020 + 0x0005a> in <5bdbd8d89a4c4dd5bd6f8f025b1007a7>:0 
  at MvvmCross.Forms.Views.MvxFormsPagePresenter+<ChangePresentation>d__20.MoveNext () [0x00435] in /Users/jagu/Projects/GitHub/MvvmCross/MvvmCross-Forms/MvvmCross.Forms/Views/MvxFormsPagePresenter.cs:205

I debug the code and the line "var masterDetailHost = GetPageOfType();" on MvxFormsPagePresenter return null

Configuration 🔧

Version: 5.7.0

Platform:

  • 🐒 Xamarin.Forms
@Cheesebaron Cheesebaron added the p/forms Xamarin.Forms platform label Apr 4, 2018
@Cheesebaron Cheesebaron changed the title XF - Crash when Close Viewmodel With Result using MasterDetail (Android & iOS) Crash when Close Viewmodel With Result using MasterDetail Apr 4, 2018
@nickrandolph
Copy link
Contributor

@juanagu a couple of requests (mainly for future issues)

  • Can you submit your example as a PR instead of just a remote repo
  • Can you please make sure your example is based off current develop (ie v6 at the moment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p/forms Xamarin.Forms platform t/bug Bug type
Development

No branches or pull requests

4 participants