You could reduce nesting by inverting this if statement and returning early.