You are required to register a result callback and save the returned ActivityResultLauncher to a variable getContent using the predefined contract GetContent. The contract defines the result as a nullable Uri. In the callback, pass the result to the function processContent() only if it is not null; if it is null, ignore it.
The function signature of processContent() is processContent(uri: Uri): Unit hence it does not accept null values. You can access the contract as GetContent or ActivityResultContracts.GetContent.