question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using sample Todo App and deleting last todo item causes Unhandled exception - Value cannot be null Parameter name: item

See original GitHub issue

The walkthrough for the Todo App references the sample in this repo.

https://docs.microsoft.com/en-gb/mobile-blazor-bindings/walkthroughs/todo-app

https://github.com/dotnet/MobileBlazorBindings/tree/main/samples/MobileBlazorBindingsTodoSample

If I delete the last item in the list I will get an Unhandled exception - Value cannot be null Parameter name: item on emulated Android Pixel 2 Q 10.0 - API 29.

It also occurs if I enter the last item in the list, press cancel, access any other value in the list and press delete.

image

Emulated device:

image

I Initially thought it was due to await contentPage.PopModalAsync(); in method OnDeleteClick in file TodoEntryDetails.razor but it happens if this code is commented out as well.

It does work If I place the delete button in TodoEntry.razor instead of TodoEntryDetails.razor. Then tried removing todoEntryDialog.FinishClosingDialog(); in OnDetailsClosed but that did not help. My guess is it has something to do with ModalContainer.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Ogglascommented, Mar 30, 2021

@Eilon Perfect! Yes the ModalContainer is a nice experiment but it needs some work. 😃 When I placed the delete button in TodoEntry.razor and accessed details for an item and then removed that item the same bug appears. Happens on iPhone simulator and local device as well.

1reaction
Eiloncommented, Mar 30, 2021

Hmm yes, the ModalContainer control is… hacky… at best! It was an experiment on how to go between Blazor and Xamarin.Forms and back again, and it works great… until it doesn’t 😄 We’ll have to take a look at this to see what’s going on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Value cannot be null. Parameter name: source
Using the .Count() without checking for null is one strong reason for this error. THE FIX: if(someList !=
Read more >
Why do I get an error "value cannot be null (Parameter ...
I am using the example code from https://learn.microsoft.com/en-us/answers/questions/299791/saving-to-appsettingsjson.html.
Read more >
Value cannot be null. Parameter name: items ...
An unhandled exception occurred while processing the request. ArgumentNullException: Value cannot be null. Parameter name: items Microsoft.
Read more >
How to Handle the ArgumentNullException in C# | Rollbar
Parse() cannot be null. Unhandled Exception: System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.
Read more >
Error handling in Step Functions
An attempt to replace a field, within a state's Parameters field, whose name ends in .$ using a path fails. States.Permissions. A Task...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found