Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash in UserDefaults when setting a nil value. #748

Open
Minddol opened this issue Feb 19, 2021 · 1 comment · Fixed by #734
Open

Fix crash in UserDefaults when setting a nil value. #748

Minddol opened this issue Feb 19, 2021 · 1 comment · Fixed by #734
Assignees
Labels
crash crash report

Comments

@Minddol
Copy link
Contributor

Minddol commented Feb 19, 2021

NUGU SDK for iOS Environment

  • sdk version: 0.28.2

Relevant System Logs

2021-02-18 13:48:22.118409+0900 SampleApp[7954:2715207] [User Defaults] Attempt to set a non-property-list object <null> as an NSUserDefaults/CFPreferences value for key refreshToken
2021-02-18 13:48:22.122642+0900 SampleApp[7954:2715207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object null for key refreshToken'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001052f729b __exceptionPreprocess + 331
	1   libobjc.A.dylib                     0x0000000104419735 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001052f70f5 +[NSException raise:format:] + 197
	3   CoreFoundation                      0x000000010520d1c8 _CFPrefsValidateValueForKey + 312
	4   CoreFoundation                      0x000000010520d65c -[CFPrefsSource setValues:forKeys:count:copyValues:removeValuesForKeys:count:from:] + 380
	5   CoreFoundation                      0x000000010520d9ec -[CFPrefsSource setValues:forKeys:count:copyValues:from:] + 28
	6   CoreFoundation                      0x000000010520da43 -[CFPrefsSource setValue:forKey:from:] + 67
	7   CoreFoundation                      0x00000001052edb7e __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 318
	8   CoreFoundation                      0x00000001052ed2ca normalizeQuintuplet + 314
	9   CoreFoundation                      0x00000001052eda34 -[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 100
	10  CoreFoundation                      0x00000001052c9c2b -[_CFXPreferences setValue:forKey:appIdentifier:container:configurationURL:] + 91
	11  CoreFoundation                      0x00000001052ce085 _CFPreferencesSetAppValueWithContainer + 117
	12  Foundation                          0x0000000103ebdee1 -[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 55
	13  SampleApp                           0x000000010282a786 $s9SampleApp11UserDefaultV12wrappedValuexvs + 454
	14  SampleApp                           0x000000010286a51f $sSo14NSUserDefaultsC9SampleAppE8StandardO12refreshTokenSSSgvsZ + 127
	15  SampleApp                           0x000000010285caa3 $s9SampleApp18NuguCentralManagerC17authorizationInfo33_FC9167D502BB17DCCE77A4A48EB1C47FLL0C8LoginKit013AuthorizationG0VSgvW + 387
	16  SampleApp                           0x000000010285cb88 $s9SampleApp18NuguCentralManagerC17authorizationInfo33_FC9167D502BB17DCCE77A4A48EB1C47FLL0C8LoginKit013AuthorizationG0VSgvs + 200
	17  SampleApp                           0x000000010285f0ce $s9SampleApp18NuguCentralManagerC5login4from10completionySo16UIViewControllerC_ys6ResultOyytAA0aB5ErrorOGctFyAJy0C8LoginKit17AuthorizationInfoVAN0cmnL0OGcfU0_ + 702
	18  NuguLoginKit                        0x0000000103d10992 $s12NuguLoginKit0A11OAuthClientC9authorize5grant10completionyAA0E16CredentialsGrantV_ys6ResultOyAA17AuthorizationInfoVAA0abC5ErrorOGcSgtFyAJy10Foundation4DataVAN8APIErrorOGcfU_ + 658
	19  NuguLoginKit                        0x0000000103d27b73 $s12NuguLoginKit13ApiProvidablePAAE7request10completionSo20NSURLSessionDataTaskCys6ResultOy10Foundation0I0VAA0abC5ErrorO8APIErrorOGcSg_tFyALSg_So13NSURLResponseCSgs0M0_pSgtcfU2_ + 1667
	20  NuguLoginKit                        0x0000000103d28e48 $s10Foundation4DataVSgSo13NSURLResponseCSgs5Error_pSgIegggg_So6NSDataCSgAGSo7NSErrorCSgIeyByyy_TR + 296
	21  CFNetwork                           0x0000000107dc0ef0 __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 19
	22  CFNetwork                           0x0000000107dd70bc __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 172
	23  Foundation                          0x0000000103e8819d __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
	24  Foundation                          0x0000000103e880a4 -[NSBlockOperation main] + 68
	25  Foundation                          0x0000000103e84e13 -[__NSOperationInternal _start:] + 689
	26  Foundation                          0x0000000103e8ae4a __NSOQSchedule_f + 227
	27  libdispatch.dylib                   0x0000000108d865d1 _dispatch_call_block_and_release + 12
	28  libdispatch.dylib                   0x0000000108d8763e _dispatch_client_callout + 8
	29  libdispatch.dylib                   0x0000000108d8a589 _dispatch_continuation_pop + 565
	30  libdispatch.dylib                   0x0000000108d89963 _dispatch_async_redirect_invoke + 859
	31  libdispatch.dylib                   0x0000000108d98028 _dispatch_root_queue_drain + 351
	32  libdispatch.dylib                   0x0000000108d989cd _dispatch_worker_thread2 + 130
	33  libsystem_pthread.dylib             0x000000010917f9f7 _pthread_wqthread + 220
	34  libsystem_pthread.dylib             0x000000010917eb77 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object null for key refreshToken'
terminating with uncaught exception of type NSException
@Minddol Minddol added the crash crash report label Feb 19, 2021
@Minddol Minddol linked a pull request Feb 19, 2021 that will close this issue
9 tasks
@Minddol
Copy link
Contributor Author

Minddol commented Feb 19, 2021

좀 더 나은 방법에 대한 고민이 필요 합니다.

@childc childc closed this as completed Aug 23, 2021
@childc childc reopened this Aug 23, 2021
@childc childc assigned childc and jin-marino and unassigned childc Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash crash report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants