The error was null.occupant, so what it's saying is src.connected = null and then you're trying to access occupant.

So this should be:
if(src.connected)
   occupant = src.connected.occupant