Another edge case might be something like '2.8.0beta' - not sure how much effort you want to go through but should probably handle the type exception gracefully.