# Why does the derived class condition meet or return a null pointer？？

**URL:** <https://discourse.vtk.org/t/why-does-the-derived-class-condition-meet-or-return-a-null-pointer/10495>\
**Category:** Development\
**Tags:** code\
**Created:** [January 19, 2023, 2:36am UTC](https://discourse.vtk.org/t/why-does-the-derived-class-condition-meet-or-return-a-null-pointer/10495 "2023-01-19T02:36:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlon.ma](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marlon.ma/32/6091_2.png) [@marlon.ma](https://discourse.vtk.org/u/marlon.ma)\
**Post date:** [January 19, 2023, 2:36am UTC](https://discourse.vtk.org/t/why-does-the-derived-class-condition-meet-or-return-a-null-pointer/10495/1 "2023-01-19T02:36:26Z")

</div>

auto maptocolor=vtkImageMapToWindowLevelColors::SafeDownCast(temp);

the temp  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/7/775e091e1af90acacd1db912dc65afb92b4c60ab.png)

 ![image](https://discourse.vtk.org/uploads/default/original/2X/a/a33d0364e93083d9e27c4dab8814924fde4fad15.png)

---

<div class="post-metadata">

**Author:** ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)\
**Post date:** [January 20, 2023, 2:41pm UTC](https://discourse.vtk.org/t/why-does-the-derived-class-condition-meet-or-return-a-null-pointer/10495/2 "2023-01-20T14:41:06Z")

</div>

Hello,

Can you, please, post the code that declares the derived class?

best,

Paulo

---

<div class="post-metadata">

**Author:** ![marlon.ma](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marlon.ma/32/6091_2.png) [@marlon.ma](https://discourse.vtk.org/u/marlon.ma)\
**Post date:** [February 6, 2023, 8:16am UTC](https://discourse.vtk.org/t/why-does-the-derived-class-condition-meet-or-return-a-null-pointer/10495/3 "2023-02-06T08:16:53Z")

</div>

thank you ,I know the I know where I am wrong, and I have a wrong understanding of downward conversion, but now I have understood.
