mirror of
				https://github.com/SimpleMobileTools/Simple-Dialer.git
				synced 2025-06-05 21:49:23 +02:00 
			
		
		
		
	adding a null check at blocking calls from not stored contacts
This commit is contained in:
		| @@ -14,12 +14,14 @@ class SimpleCallScreeningService : CallScreeningService() { | |||||||
|  |  | ||||||
|     override fun onScreenCall(callDetails: Call.Details) { |     override fun onScreenCall(callDetails: Call.Details) { | ||||||
|         if (baseConfig.blockUnknownNumbers) { |         if (baseConfig.blockUnknownNumbers) { | ||||||
|  |             if (callDetails.handle != null) { | ||||||
|                 val simpleContactsHelper = SimpleContactsHelper(this) |                 val simpleContactsHelper = SimpleContactsHelper(this) | ||||||
|             val number = Uri.decode(callDetails.handle?.toString()).substringAfter("tel:") |                 val number = Uri.decode(callDetails.handle?.toString() ?: "").substringAfter("tel:") | ||||||
|                 val privateCursor = getMyContactsCursor(false, true) |                 val privateCursor = getMyContactsCursor(false, true) | ||||||
|                 simpleContactsHelper.exists(number, privateCursor) { exists -> |                 simpleContactsHelper.exists(number, privateCursor) { exists -> | ||||||
|                     respondToCall(callDetails, !exists) |                     respondToCall(callDetails, !exists) | ||||||
|                 } |                 } | ||||||
|  |             } | ||||||
|         } else { |         } else { | ||||||
|             respondToCall(callDetails, false) |             respondToCall(callDetails, false) | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user