Invalid input in related products field caused database exception (#1158)