LottieSharp icon indicating copy to clipboard operation
LottieSharp copied to clipboard

Object reference not set to an instance of an object

Open sarahBenzaquen opened this issue 2 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here. I need to use a json to make a gif , and when i put the control in my page the error " Object reference not set to an instance of an object" appears , my json is ok i have tried it like embedded resources and also content and it's not working, I don't know how to solve this please

sarahBenzaquen avatar May 11 '22 15:05 sarahBenzaquen

You need to set the build action to none, and select "copy to output directory"

strathdeek avatar May 16 '22 14:05 strathdeek

I think that if you look closely to the errors, you will see the same error:

image

The null reference exception comes after the first one so the real error is that the lottie viewer cannot find your .JSON file :

image

Try to remove the first slash from path:

image

So it's like this:

image

And set the properties of the .json file to this:

image

keytrap-x86 avatar Jun 24 '22 21:06 keytrap-x86