FLEX-33710: Changed the Range out of bounds check to a try/catch for a range error.