function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Srini KanuriSrini Kanuri 

Error in $A.getCallback() [Cannot read property 'Name' of null]

AccountFormAndList.cmp:
<aura:component controller="CampingListController">
    <aura:attribute name="cont" type="Account" />
    <lightning:layout >
        <lightning:layoutItem size="3">
        <form>
            <lightning:input name="conName" label="Name" aura:id="conForm" 
                                     value="{!v.cont.Name}" required="true" 
                                     messageWhenValueMissing="Name is required"
                                     placeholder="ACC Name"/>
            <lightning:button label="Create" onclick="{!c.clickCreate}" />
        </form>
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>

Controller:
({
    clickCreate : function(component, event, helper) {
        var getCon=component.get("v.cont");
        var action=Component.get("c.saveContact");
        action.setParams({
            "con": getCon
        });
        action.setCallback(this,function(response){
         //  component.set("v.contacts",response.getReturnValue());
         var state=response.getState();
            if(state==="SUCCESS"){
                var name=a.getReturnValue();
                alert("Hello from here"+name);
            }
        });
        $A.enqueueAction(action);
    }
})

Apex Class:

@AuraEnabled
    public static Account saveContact(Account con){
        upsert con;
        return con;
    }


I am getting below error when we type any letters in the input text box;
User-added image

Help me in this.

Thanks
Srinivas
Srini KanuriSrini Kanuri
Hi,

It's resolved with default values.

Thanks
Srinivas
Deepu B 5Deepu B 5
Hi,

I am facing the same the issue :
Uncaught Error in $A.getCallback() [Cannot read properties of null (reading 'isSuccess')]
Callback failed: apex://Profile2PermSet.permissionSetGroupsList/ACTION$getPermissionSetGroupsList


Can you please let me know what needs to be done as i am new to coding.Thank you