title: ERROR TypeError: Cannot read property 'replace' of null
body: <p>I am having a TypeError, although my application is running properly. </p>
  
  <blockquote>
    <p>"ERROR TypeError: Cannot read property 'replace' of null"</p>
  </blockquote>
  
  <p>How to resole this issue?
  <a href="https://i.stack.imgur.com/KIyw6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KIyw6.png" alt="enter image description here"></a></p>
  
  <pre><code>if (isInitial) {
  
                    // Add Data Rows (initially)
                    for(const row of rows) {
  
                      const clientVisitGuid = row[2];
                      const location = row[3];
  
                      row[5] = row[5].replace(/\//g, '\/\u200B');
                      const service = row[5];
  
                      const rowId = `${service || 'zzz'}_${location}_${clientVisitGuid}`;
                      const sortString = `${service || 'zzz'}_${location}_${clientVisitGuid}`;
                      const daysPastDischarge = parseInt(row[6]);
                      const isMarked = parseInt(row[7]) === 1 ? true : false;
  
                      if (cbt.hasBodyRow(rowId) === false) {
  
                        const values: Array&lt;[string, string | number]&gt; = [];
                        let isAllClear = true;
                        for(let i = 0; i &lt; row.length; i++) {
                          const colId: string = cbt.headerRow.headerCols[i].id;
                          const colVal: string | number = row[i];
                          if (cbt.headerRow.headerCols[i].isFlag === true &amp;&amp; colVal !== 1) {
                            isAllClear = false;
                          }
                          values.push([colId, colVal]);
                        }
  
                        const valueHash = hash(JSON.stringify(row));
  
                        cbt.addBodyRow(
                          rowId,
                          values,
                          valueHash,
                          sortString,
                          daysPastDischarge,
                          isMarked,
                          isAllClear,
                          true,
                        );
                      }
                    }
  </code></pre>