{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1682","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1682/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1682/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1682/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1682","id":177167192,"number":1682,"title":"System.NullReferenceException: iOS only","user":{"login":"DavidStrickland0","id":12382552,"avatar_url":"https://avatars.githubusercontent.com/u/12382552?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidStrickland0","html_url":"https://github.com/DavidStrickland0","followers_url":"https://api.github.com/users/DavidStrickland0/followers","following_url":"https://api.github.com/users/DavidStrickland0/following{/other_user}","gists_url":"https://api.github.com/users/DavidStrickland0/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidStrickland0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidStrickland0/subscriptions","organizations_url":"https://api.github.com/users/DavidStrickland0/orgs","repos_url":"https://api.github.com/users/DavidStrickland0/repos","events_url":"https://api.github.com/users/DavidStrickland0/events{/privacy}","received_events_url":"https://api.github.com/users/DavidStrickland0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2016-09-15T12:47:49Z","updated_at":"2016-11-29T23:19:30Z","closed_at":null,"body":"Trying to map an Ilist of Interfaces to an IList of implementations I am getting a Nullreference error. However I only receive this on iOS the same implementation works fine on Android. The error does not occur at the mapping the mapping goes through fine and the resulting collection appears to be fine. However after the event (onappearing) in which the map occurs completes only then does this error get raised. Presumably this is a Async method that doesnt complete till later a dispose or some other threading issue. \n\nDowngrading to Automapper 4.2.1 resolves the error.\n\nGood Luck - if this is half as hard to fix as it was to track down its going to be a pain for someone.\n\n*\\* Version\nUsing AutoMapper\" version=\"5.1.1\" targetFramework=\"portable45-net45+win8+wpa81\" on iOS\n\n*\\* Error\nSystem.NullReferenceException: Object reference not set to an instance of an object\n\n*\\* Code\nvar items = DataMapper.Mapper.Map<IList<IDailyChallenge>, IList<DailyChallengeViewModel>>(dailychallenges);\n\n*\\* Stack Trace\n  at Microsoft.Scripting.Interpreter.LoopCompiler.VisitVariable (System.Linq.Expressions.ParameterExpression node, Microsoft.Scripting.Ast.ExpressionAccess access) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LoopCompiler.cs:279 \n  at Microsoft.Scripting.Interpreter.LoopCompiler.VisitParameter (System.Linq.Expressions.ParameterExpression node) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LoopCompiler.cs:271 \n  at System.Linq.Expressions.ParameterExpression.Accept (System.Linq.Expressions.ExpressionVisitor visitor) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs:118 \n  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression node) [0x00006] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:57 \n  at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall (System.Linq.Expressions.MethodCallExpression node) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:414 \n  at System.Linq.Expressions.MethodCallExpression.Accept (System.Linq.Expressions.ExpressionVisitor visitor) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs:106 \n  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression node) [0x00006] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:57 \n  at System.Linq.Expressions.ExpressionVisitor.VisitBinary (System.Linq.Expressions.BinaryExpression node) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:198 \n  at Microsoft.Scripting.Interpreter.LoopCompiler.VisitBinary (System.Linq.Expressions.BinaryExpression node) [0x000b4] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LoopCompiler.cs:254 \n  at System.Linq.Expressions.BinaryExpression.Accept (System.Linq.Expressions.ExpressionVisitor visitor) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs:331 \n  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression node) [0x00006] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:57 \n  at System.Linq.Expressions.ExpressionVisitor.VisitConditional (System.Linq.Expressions.ConditionalExpression node) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:250 \n  at System.Linq.Expressions.ConditionalExpression.Accept (System.Linq.Expressions.ExpressionVisitor visitor) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs:93 \n  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression node) [0x00006] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:57 \n  at System.Linq.Expressions.ExpressionVisitor.VisitLoop (System.Linq.Expressions.LoopExpression node) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:378 \n  at System.Linq.Expressions.LoopExpression.Accept (System.Linq.Expressions.ExpressionVisitor visitor) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs:82 \n  at System.Linq.Expressions.ExpressionVisitor.Visit (System.Linq.Expressions.Expression node) [0x00006] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/System.Core/Microsoft/Scripting/Ast/ExpressionVisitor.cs:57 \n  at Microsoft.Scripting.Interpreter.LoopCompiler.CreateDelegate () [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/LoopCompiler.cs:82 \n  at Microsoft.Scripting.Interpreter.EnterLoopInstruction.Compile (System.Object frameObj) [0x00074] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/dlr/Runtime/Microsoft.Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs:601 \n  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x0000e] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:1304 \n  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:957 \n  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:904 \n  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:1281 \n  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:854 \n  at ObjCRuntime.Runtime.ThreadPoolDispatcher (System.Func`1[TResult] callback) [0x00006] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/src/ObjCRuntime/Runtime.cs:238 \n  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x0000c] in /Users/builder/data/lanes/3426/6c3fee4d/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs:1206 \n"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/263732149","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1682#issuecomment-263732149","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1682","id":263732149,"user":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T23:19:30Z","updated_at":"2016-11-29T23:19:30Z","body":"@kyurkchyan there actually is a +1 to comments btw :)"}}
{"actor":{"display_login":"jbogard"}}