protected void UserControl_ButtonClick(object sender, EventArgs e) {
var uri = string.Format("https://api.ethplorer.io/getTokenInfo/{0}?apiKey=apikey", addTokenPop.getAddress());
if (GetResponseText(uri) == "") {
MessageBox.Show("Incorrect Address / Network Error");
addTokenPop.resetBox();
addTokenPop.Hide();
} else {
Properties.WalletData.Default.tokens.Add(addTokenPop.getAddress());
Properties.WalletData.Default.Save();
addTokenPop.resetBox();
addTokenPop.Hide();
}
}
程序通过if语句,跳转到else语句,在执行Properties.WalletData.Default.tokens.Add(addTokenPop.getAddress());
之前,它具有NullReferenceException。 NullReferenceException显示在void的最后花括号中