I was new to salesforce. I was try trying to update that account record name belong to me. I am getting System.NullPointerException: Attempt to de-reference a null object could some can help me here is my class
public class MyController {
private final Account account;
public MyController() {
list<Account> account = [SELECT Id, Name, Site FROM Account WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
}
public Account getAccount() {
return account;
}
public PageReference save() {
update account;
return null;
}
}