Genesis 38:10

10 And the thing which he did displeased the LORD; therefore He slew him also.