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.

Null input binding throws an exception

See original GitHub issue

When attempting to use an input binding to something like CosmosDB, if the input binding is empty (e.g. referencing an ID that isn’t there), the function throws right away (with an error about not able to convert NoneType to func.Document or str or whatever). However, with other languages like JavaScript, the function still executes, the input binding is just null. This prevents doing things like gracefully handling a null input binding and returning an error.

https://stackoverflow.com/questions/57979944/azure-function-written-in-python-has-500-when-id-binding-points-doesnt-have-a

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
maiqbal11commented, Sep 23, 2019

We decode the data from Cosmos but right now we aren’t checking for the case where the data in None: https://github.com/Azure/azure-functions-python-library/blob/edce123f18b2b45d0d18c0bccd6e934290af0dee/azure/functions/cosmosdb.py#L24. Will add a fix shortly.

0reactions
Hazhzengcommented, Oct 22, 2019

The fix has been merged to the python library, it will go with the next 1.0.5 release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Null Reference Exception when attempting to bind ...
Actually that kind of cast throws an exception. You would need var ddlEligibility = (fvSubscriber.FindControl("ddlEligibility")) as DropDownList ...
Read more >
Binding to property Item throws a NullReferenceException ...
Net 4.5 we get a NullReferenceException when we bind to a property ... IndexerName for checking (Binding.IndexerName has value "Item[]" ).
Read more >
Binding nullable int to input causes null reference exception
If I have a nullable string in a database and I want to bind using blazor I don't like having to do some...
Read more >
Binding to a null string Value throws NullReferenceException
I stumbled over an exception when one of the items in the dropdownlist ("Data" property) has Null in the property specified as "TextField"...
Read more >
Understanding null safety - Dart programming language
If you run this Dart program without null safety, it throws a NoSuchMethodError exception on the call to .length . The null value...
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