[backport] add back a check that got accidentically removed; fixes #12379 (#12444)
[backport] add back a check that got accidentically removed; fixes #12379 (#12444)


dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim,dom96/Nim