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.

Object reference not set to an instance of an object

See original GitHub issue

Hi,

I’m using Microsoft.Identity.Client, Version=1.1.3.-preview0012

And i’ve got this error on iOS. (android works fine)

{System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.Identity.Client.TokenCacheAccessor.Remove (System.String key, System.String service) [0x00055] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.TokenCacheAccessor.SetValueForKey (System.String key, System.String value, System.String service) [0x00000] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.TokenCacheAccessor.SaveAccessToken (System.String cacheKey, System.String item) [0x00000] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.Internal.Telemetry.TelemetryTokenCacheAccessor.SaveAccessToken (System.String cacheKey, System.String item, Microsoft.Identity.Client.Internal.RequestContext requestContext) [0x00023] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.TokenCache.SaveAccessAndRefreshToken (Microsoft.Identity.Client.Internal.Requests.AuthenticationRequestParameters requestParams, Microsoft.Identity.Client.Internal.OAuth2.TokenResponse response) [0x00291] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.Internal.Requests.RequestBase.SaveTokenResponseToCache () [0x001a8] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.Internal.Requests.RequestBase.PostTokenRequest () [0x00008] in <7f73819fd99b45669100adda813d89e4>:0 at Microsoft.Identity.Client.Internal.Requests.RequestBase+<RunAsync>d__33.MoveNext () [0x00360] in <7f73819fd99b45669100adda813d89e4>:0 — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535 at Microsoft.Identity.Client.PublicClientApplication+<AcquireTokenForUserCommonAsync>d__18.MoveNext () [0x000d2] in <7f73819fd99b45669100adda813d89e4>:0 — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.10.1.178/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 …

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

4reactions
muhammetsahincommented, Jun 1, 2018

@jennyf19 thank you so much you are really fast.

0reactions
jennyf19commented, Nov 3, 2018

@Journeyman42 - That is not correct. We do not have broker for MSAL yet. I will update the wiki. It should be:

public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
{
        if (!AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(url))
        {
                return false;
        }
        return true;
}

Can you open an issue in MSAL with the logs and stack trace? this will help us investigate the issue you’re running into. thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >
What does "Object reference not set to an instance of an ...
If you try to access a member of a class instance using a null reference then you get a System.NullReferenceException. Which is the...
Read more >
How to solve error object reference not set to an instance of ...
I work on csharp i get error object reference not set to an instance of an object code give me error var Data...
Read more >
Object reference not set to an instance of an object. - Forum
The message "object reference not set to an instance of an object" means that you are referring to an object the does not...
Read more >
Object reference not set to an instance of an object” error?
The “Object reference not set to an instance of an object” is a very famous error in C# that appears when you get...
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