Fix possible crash

Heinz, please check if this is the right fix

BUG: 337100