settings_data: Handle potential null dereferences