Port fix for PR #19901 to 1.2.x branch - Adding check for null page value and throwing more informative exception
Changed paths: