core: fix crash in evaluation of expression when reading a string in hdata with a NULL value (bug #39419)