# Basic array existing question

**URL:** https://forum.kirupa.com/t/basic-array-existing-question/296458
**Category:** Uncategorized
**Created:** [September 15, 2009, 9:25am UTC](https://forum.kirupa.com/t/basic-array-existing-question/296458 "2009-09-15T09:25:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![cpthk](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@cpthk](https://forum.kirupa.com/u/cpthk)
#### Post date: [September 15, 2009, 9:25am UTC](https://forum.kirupa.com/t/basic-array-existing-question/296458/1 "2009-09-15T09:25:45Z")

</div>

Hi:

```auto

if(event.result != null){
    if(event.result.data != null)
        func1(event.result.data);
    }
}

```

I was wondering on the second line, the if statement access the data element. What if data element does not exist at all, will that cause runtime error? Do I have to check if data element exist before accessing it?

This code is c, c++ language won’t even compile I think.
