It seems kinda bizarre to return a flag + possibly valid data in this way. How about doing the check in a separate method?