Discuss your approach to debugging a piece of code during a live coding session.
In the exercise, inspect and correct a function that should return the first value appearing twice in an integer array. Explain how you reproduce the failure, isolate the cause, validate the fix, and consider edge cases.
Implement find_first_duplicate(nums). Return the first repeated value, or None if every value is unique.
def find_first_duplicate(nums):