Don't fail if there's nothing to feed to `max()`.
Merge pull request #6837 from s0undt3ch/develop

Don't fail if there's nothing to feed to `max()`.