(settings) Fix use-after-free.
Move this assignment outside the two-line conditional.
Fix segfault.