Add null check + formatting

Fixes https://github.com/Open-Code-Developers/BoatCraft/issues/188 .