hbb20 / hbb20/CountryCodePickerProject
java.lang.NullPointerException: Attempt to read from field 'java.lang.String com.hbb20.CCPCountry.phoneCode' on a null object reference
- 主要语言
- Java
- 星标
- 1.5k
- 派生
- 509
- PR 合并指标
- 30 天内没有已合并 PR
描述
I am getting an error while calling fullNumberWithPlus function.
```
package com.example.invoiceinventory.Activities
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.invoiceinventory.R
import com.example.invoiceinventory.Utils.Constants
import com.example.invoiceinventory.databinding.ActivityAuthenticationBinding
import com.hbb20.CountryCodePicker
class AuthenticationActivity : AppCompatActivity() {
private lateinit var ccp:CountryCodePicker
private lateinit var binding:ActivityAuthenticationBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding= ActivityAuthenticationBinding.inflate(layoutInflater)
setContentView(binding.root)
ccp= CountryCodePicker(this)
ccp.registerCarrierNumberEditText(binding.authPhoneNo)
binding.authSubmitBtn.setOnClickListener {
val intent= Intent(this,OtpActivity::class.java)
intent.putExtra(Constants.phoneNum,ccp.fullNumberWithPlus.replace(" ","") )// I am getting error in this line
startActivity(intent)
}
}
}
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start by reproducing the AuthenticationActivity snippet, focusing on ccp.registerCarrierNumberEditText(binding.authPhoneNo) and the ccp.fullNumberWithPlus call. Inspect the library's handling of fullNumberWithPlus and identify the required state for it to return a value; done means the reported null dereference is reproduced and either prevented or clearly explained.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, kotlin
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100