title: Why am I getting a null error when mapping over this array?
body: <p>I'm trying to map over my API to get the nodes. </p>
  
  <p>Here is the format my API is in: </p>
  
  <pre><code>[
      {
          "agent": "....",
          "managementDomain": "...",
          "node": "..."
      },
      {
          "agent": "....",
          "managementDomain": "...",
          "node": "..."
      },
  ...
  ]
  </code></pre>
  
  <p>The format I need to get it into for react-select: </p>
  
  <pre><code>const colourOptions = [
      { value: 'orange', label: 'Orange' },
      { value: 'yellow', label: 'Yellow' },
      { value: 'green', label: 'Green' },
      ];
  </code></pre>
  
  <p>How I am mapping over it (using Redux for state management): </p>
  
  <pre><code>const alarms = this.props.dataReducer.alarmDetails
  
  const {test} = alarms.map(alarm =&gt; ({value:alarm.node, label: alarm.node}))
  </code></pre>
  
  <p>The error I am getting: </p>
  
  <pre><code>TypeError: Cannot read property 'node' of null
  </code></pre>
  
  <p>console.log(this.props.dataReducer.alarmDetails)</p>
  
  <pre><code>(288) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, null, {…}, {…}, {…}, {…}, null, {…}, {…}, null, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, null, null, null, {…}, {…}, {…}, {…}, {…}, null, {…}, {…}, {…}, {…}, {…}, {…}, …]
  
  [0 … 99]
  0:
  agent: "..."
  managementDomain: null
  node: "..."
  </code></pre>
  
  <p>What's the best way to map over the API to get the node from each object within the array?</p>