Accessed none for add to viewport after 4.9 update

Check if you have selected “play on dedicated server” on the multiplayer options of your game menu. That may solve the issue, but then you detected code that is not working properly on multiplayer setups.