我用的是 Unity的 sdk。 当获取 AVLeaderboard时,如果leaderboard设置为 不重置,会报错。但如果把重置改为每周/天/月,就不报错。
challengeModeHistoryLeaderboard = await AVLeaderboard.GetLeaderboard(kChallengeModeHistoryStatisticName_Score);
报错log:
AVEXCEPTION: LeanCloud.AVException: Object reference not set to an instance of an object
at LeanCloud.AVLeaderboard+<>c.b__43_0 (System.Threading.Tasks.Task1[TResult] t) [0x00022] in <c6b28e5de1c34c4fb8a4988a57f6d4ef>:0
at LeanCloud.Storage.Internal.InternalExtensions+<>c__DisplayClass5_0
2[TIn,TResult].b__0 (System.Threading.Tasks.Task t) [0x00000] in <6f50b7c221814d36ac76e75fb0137036>:0
at LeanCloud.Storage.Internal.InternalExtensions+<>c__DisplayClass7_01[TResult].<OnSuccess>b__0 (System.Threading.Tasks.Task t) [0x0006d] in <6f50b7c221814d36ac76e75fb0137036>:0
at System.Threading.Tasks.ContinuationResultTaskFromTask
1[TResult].InnerInvoke () [0x00024] in <9577ac7a62ef43179789031239ba8798>:0
at System.Threading.Tasks.Task.Execute () [0x00010] in <9577ac7a62ef43179789031239ba8798>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0
at EWLeanCloudManager+<GetChallengeModeScoreHistoryLeaderboard>d__59.MoveNext () [0x00035] in D:\P4\globe\Assets\EarthWiki\Scripts\EWLeanCloudManager.cs:748
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter
1[TResult].GetResult () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0
at EWLeanCloudManager+d__57.MoveNext () [0x0005f] in D:\P4\globe\Assets\EarthWiki\Scripts\EWLeanCloudManager.cs:699
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0
at EWMainSceneMenuManager+d__194.MoveNext () [0x001f8] in D:\P4\globe\Assets\EarthWiki\Scripts\UI\EWMainSceneMenuManager.cs:4083
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9577ac7a62ef43179789031239ba8798>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0
at EWMainSceneMenuManager+d__196.MoveNext () [0x00351] in D:\P4\globe\Assets\EarthWiki\Scripts\UI\EWMainSceneMenuManager.cs:4242