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

NSInvalidArgumentException key cannot be nil #50

Open
gurmukhp opened this issue Nov 14, 2021 · 2 comments
Open

NSInvalidArgumentException key cannot be nil #50

gurmukhp opened this issue Nov 14, 2021 · 2 comments

Comments

@gurmukhp
Copy link

gurmukhp commented Nov 14, 2021

Thanks for building this app, it's the only safe way to migrate chats from Android to iPhone!

When trying to migrate my chats, I get the following error:

2021-11-14 22:22:46.122 watoi[7909:101018] 	 is group chat
2021-11-14 22:22:46.122 watoi[7909:101018] 	 not found member (null)
2021-11-14 22:22:46.122 watoi[7909:101018] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSDictionaryM setObject:forKey:]: key cannot be nil'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff204c01db __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff201f9d92 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff20576e0a _CFThrowFormattedException + 202
	3   CoreFoundation                      0x00007fff20582a1e -[__NSDictionaryM setObject:forKey:].cold.2 + 0
	4   CoreFoundation                      0x00007fff20402cbc -[__NSDictionaryM setObject:forKey:] + 917
	5   watoi                               0x00000001031fdb2f -[Importer addMissingMember:toChat:asAdmin:] + 575
	6   watoi                               0x00000001031fe40f -[Importer importChats] + 2216
	7   watoi                               0x00000001031fcef5 -[Importer import] + 27
	8   watoi                               0x00000001031fca1b main + 343
	9   libdyld.dylib                       0x00007fff20369f3d start + 1
	10  ???                                 0x0000000000000004 0x0 + 4
)
libc++abi: terminating with uncaught exception of type NSException
Abort trap: 6

It looks like a null check, is there a quick fix for this?

@gurmukhp
Copy link
Author

gurmukhp commented Nov 14, 2021

Adding an if check around memberJID seemed to work, although now all chat messages do not have a name associated to them...

    if (memberJID) {
      [member setValue:chat forKey:@"chatSession"];
      [members setObject:member forKey:memberJID];
    }

@ammadanjumch
Copy link

any update on this @gurmukhp ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants