FindFirstChild "attempt to index nil"

I’m using an if statement to detect if there is an object in the workspace. However, this just throws up an error saying “attempt to index nil with ‘UpperTorso’”.

if game.Workspace:FindFirstChild(descendant.Parent.Occupant.Value).UpperTorso then

If it can’t find it, I just want it to restart the while wait loop it is it.

I would personally do this instead:

local occ = game.Workspace:FindFirstChild(descendant.Parent.Occupant.Value)
if occ then
    if occ.UpperTorso then
        --stuff
    end
else
    print("oh no")
end