无法设置未定义或 null 引用的属性“value” ,如何解决?

SCRIPT5007: 无法设置未定义或 null 引用的属性“value”
mainFrameForm.gsClientCorporateDtoBussinessSource.value = bussinessSourceArray['codeCode']有什么错误请问

  var bussinessSourceArray = new Array();
        bussinessSourceArray['codeCode']=QueryResultFrame.document.getElementsByName("codeCode")[clientIndex].value;
      bussinessSourceArray['codeCName']=QueryResultFrame.document.getElementsByName("codeCName")[clientIndex].value;
        
        if(evaluateMainFrameAgreement(bussinessSourceArray, window.parent.opener.fm)){    
      }else{
          window.parent.close();
      }
   }
   function evaluateMainFrameAgreement(bussinessSourceArray,mainFrameForm){
      if(bussinessSourceArray != null) {
        var type=document.getElementsByName("type")[0].value;
        alert(type);
        if(type==1){
             mainFrameForm.gsClientCorporateDtoBussinessSource.value = bussinessSourceArray['codeCode'];
             alert(mainFrameForm.gsClientCorporateDtoBussinessSource.value)
             mainFrameForm.gsClientCorporateDtoBussinessSource.onchange();    
        }
      }


```html
<html:form action="/sales/corporateQuery.do?actionTyp=bussinessSourceNameResult" target="QueryResultFrame">
<input type="hidden" name="type"  value="<%=request.getAttribute("type")%>">

<table id="BeforeOverViewMain" class="common" cellpadding="2" cellspacing="1"> 
    <tr><td class="formtitle" colspan="4"><bean:message key="prompt.queryBussinessSource"/>td>tr> 
    <tr>
    <td class="left"><bean:message key="GsClientCorporateDto.bussinessSource"/>td>
    <td class="right">
        <input name="bussinessSource" class="common" type="text" maxlength="18">
      td>
    <td class="left"><bean:message key="GsClientCorporateDto.bussinessSourceName"/>td>
    <td class="right">
      <input name="bussinessSourceName" class="common" type="text">
    td>
  tr>
  
 table>
<table id="buttontable" class="button" cellpadding="5" cellspacing="1">
  <tr align="center">
    <td align="center">
    
      <input type="button" class="button" value="button.find" />" onClick="queryMethod()" >
    td>
    <TD align="center">
    
        <input type="button"  class="button" value="GuItemKindLoadingDto.selectedInd" />" onClick="selectBussinessSource();" />  
     TD>
  tr>
table>
<table class="button" cellpadding="5" cellspacing="1">
   <tr>
     <td ><iframe name="QueryResultFrame" src='about:blank' style='Z-INDEX:1;WIDTH:100%;HEIGHT:410'
        marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'> iframe>td>
   tr>
table>  
<jsp:include page="/common/StaticJavascript.jsp" />
html:form>
body>
html>


```

这个元素为空或者找不到这个元素吧

img