mirror of
				https://github.com/SimpleMobileTools/Simple-Contacts.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	fix some null pointer crashes
This commit is contained in:
		| @@ -45,7 +45,7 @@ ext { | ||||
| } | ||||
|  | ||||
| dependencies { | ||||
|     implementation 'com.simplemobiletools:commons:3.18.17' | ||||
|     implementation 'com.simplemobiletools:commons:3.18.23' | ||||
|     implementation 'joda-time:joda-time:2.9.9' | ||||
|     implementation 'com.facebook.stetho:stetho:1.5.0' | ||||
|  | ||||
|   | ||||
| @@ -148,11 +148,11 @@ class EditContactActivity : ContactActivity() { | ||||
|         } | ||||
|  | ||||
|         if (contact!!.id == 0 && intent.extras?.containsKey(KEY_PHONE) == true && (action == Intent.ACTION_INSERT_OR_EDIT || action == Intent.ACTION_INSERT)) { | ||||
|             val phoneNumber = intent.extras.get(KEY_PHONE).toString() | ||||
|             val phoneNumber = intent.extras.get(KEY_PHONE).toString() ?: "" | ||||
|             contact!!.phoneNumbers.add(PhoneNumber(phoneNumber, DEFAULT_PHONE_NUMBER_TYPE)) | ||||
|             setupPhoneNumbers() | ||||
|  | ||||
|             val contactFullName = intent.extras.get(KEY_NAME).toString() | ||||
|             val contactFullName = intent.extras.get(KEY_NAME)?.toString() ?: "" | ||||
|             contact_first_name.setText(contactFullName) | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -442,7 +442,7 @@ class ContactsHelper(val activity: BaseSimpleActivity) { | ||||
|             if (cursor?.moveToFirst() == true) { | ||||
|                 do { | ||||
|                     val id = cursor.getLongValue(ContactsContract.Groups._ID) | ||||
|                     val title = cursor.getStringValue(ContactsContract.Groups.TITLE) | ||||
|                     val title = cursor.getStringValue(ContactsContract.Groups.TITLE) ?: continue | ||||
|  | ||||
|                     val systemId = cursor.getStringValue(ContactsContract.Groups.SYSTEM_ID) | ||||
|                     if (groups.map { it.title }.contains(title) && systemId != null) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user