Configuring FFImageLoading's HttpClient throws a null reference exception
See original GitHub issueI just updated from 2.7.2 to 3.1.0 and noticed the following configuration throws a null reference exception on Android.
Add this to MainActivity:
var configuration = new Configuration
{
FadeAnimationEnabled = false,
HttpClient = new System.Net.Http.HttpClient(new NativeMessageHandler())
};
I’m using FFImageLoading 2.4.11.982 and XF 4.
Adding @daniel-luberda in case this issue belongs to his code.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (8 by maintainers)
Top Results From Across the Web
c# - Why do I get a NullReferenceException when creating ...
1 Answer. You shouldn't be creating that many instances of HttpClient . This is an object that allows multiple connections at the same...
Read more >Object Reference Not Set to an Instance of an Object
This exception is thrown when you try to access a member—for instance, a method or a property—on a variable that currently holds a...
Read more >System.NullReferenceException: Object reference not set ...
Hi, I am trying the below code but it keeps throwing error when I use it on my app. Although I am not...
Read more >Null Reference Exceptions
Null Reference Exceptions. A NullReferenceException happens when you try to access a reference variable that isn't referencing any object.
Read more >What is NullReferenceException in C#? - Code Maze
In C#, a NullReferenceException occurs when we try to access a variable whose value has not been set or has been set to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alexrainman ,
Please consider an escape hatch in ModernHttpClient for guys that would like a less aggressive approach to security. Certificate pinning sounds good in theory but has significant inherent risks. When pinning a public key chain , we are assuming that the certificate authority, it’s intermediate certificates and your leaf certificate do not change.
So if you are not careful in your execution of renewing your certificate or if your certificate provider suddenly change their certificate then you are stuck as your public keys will change in such instances. Also, if your keys get compromised or if god forbid you lose them then you are forced to change your public key, so now you have to think about backup keys otherwise your users won’t be able to access your site.
In my opinion going offline is a much more severe threat than getting exposed to a sophisticated man-in-the-middle attack.
Google initiated certificate pinning and eventually abandoned it because of the lack of an build-in recovery mechanism. I know you stated version 2.7.2 is good but then many users will be stuck if something “new” breaks it.
Yes. I removed 3.x iterations as i am not planning to update this for a while.
Good to know it works as expected.