I have the following code in my component
<aura:if isTrue="{! not(empty(v.assignedto)) }">
<lightning:input aura:id="assignedToInput" value="{#v.assignedto.value}" label=""/>
<aura:set attribute="else">
<lightning:input aura:id="assignedToInput" value="" class="slds-hide" label=""/>
</aura:set>
</aura:if>
The following is the helper code
getAccountRequestListHelper : function(component,event,helper){
console.log('inside get account list helper'+component.get("v.ucn"));
var action = component.get("c.searchAccounts");
console.log('Here 1');
var assignedToId = component.find("assignedToInput1").get('v.value');
console.log('Here 2'+assignedToId);
console.log('assignedToInput'+assignedToId);
.
.
.
here I am getting an error in line
var assignedToId = component.find("assignedToInput").get('v.value');
when assignedToInput1 is not populated in the component. The assignedToInput1 value is conditional. It will not always be populated. can anyone tell me how to get over this issue