FS-5482 skypopen: check assignment on possibly NULL pointer, avoiding segfault