I got error message like “Cannot read property ‘value’ of null” when resource have no valid data to return. Can I check if valid data is available from datahub before I read it?
The following code is not working. Can someone show me the right way to do it?
if (Datahub.read(’/location/coordinates/value’, 0).value != null) {
loc0 = Datahub.read(’/location/coordinates/value’, 0).value;
} else {
return;
}