<div><span class="Apple-tab-span" style="white-space:pre">I</span> get an vtkIdTypeArray called &quot;ids&quot; like this:</div><div><br></div><div>vtkIdTypeArray* ids;</div><div>ids = vtkIdTypeArray::SafeDownCast(selectedGraph-&gt;GetVertexData()-&gt;GetArray(&quot;vtkIdFilter_Ids&quot;));</div>
<div><br></div><div>Then I check that it is valid:</div><div><br></div><div>if(!ids)</div><div>  break;</div><div><br></div><div>Then I check that it has the correct number of tuples:</div><div><br></div><div>std::cout &lt;&lt; &quot;ids has &quot; &lt;&lt; ids-&gt;GetNumberOfTuples() &lt;&lt; &quot; tuples.&quot; &lt;&lt; std::endl;</div>
<div>   </div><div>Then I try to get a value from it:</div><div>   </div><div> for(vtkIdType i = 0; i &lt; ids-&gt;GetNumberOfTuples(); i++)</div><div>    {</div><div>    vtkIdType id = ids-&gt;GetValue(i); //segfault occurs here</div>
<div><br></div><div>but a segfault occurs where indicated above.</div><div><br></div><div>Anyone know why this might happen? Or what other conditions to check before trying to access the data?</div><div><br></div>Thanks,<br>
<br>David<br>