Exit if data are not defined

If I use an async call to get my data, the chart is drawn before the data comes in, so I get an error in the console.