Repository: archlinux/archinstall

Issue:
Exception thrown on install in some configurations
(line number is one off because I hadded a line to dump the config)

```
Traceback (most recent call last):
  File "/usr/bin/archinstall", line 8, in <module>
    sys.exit(run_as_a_module())
  File "/usr/lib/python3.10/site-packages/archinstall/__init__.py", line 312, in run_as_a_module
    script.execute()
  File "/usr/lib/python3.10/site-packages/archinstall/lib/profiles.py", line 195, in execute
    self.spec.loader.exec_module(sys.modules[self.namespace])
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3.10/site-packages/archinstall/examples/guided.py", line 293, in <module>
    config_output = ConfigurationOutput(archinstall.arguments)
  File "/usr/lib/python3.10/site-packages/archinstall/lib/configuration.py", line 49, in __init__
    self._process_config()
  File "/usr/lib/python3.10/site-packages/archinstall/lib/configuration.py", line 76, in _process_config
    self._user_credentials['encryption_password'] = self._config[key].encryption_password
AttributeError: 'NoneType' object has no attribute 'encryption_password'
```

`log(self._config)` at that point:

```
{'bootloader': 'systemd-bootctl', 'config_version': '2.5.4', 'harddrives': [BlockDevice(/dev/sda, size=16.0GB, free_space=?, bus_type=sata), BlockDevice(/dev/sdb, size=1.0GB, free_space=?, bus_type=sata), BlockDevice(/dev/sdc, size=1.0GB, free_space=?, bus_type=sata)], 'nic': NetworkConfiguration(type=<NicType.ISO: 'iso'>, iface=None, ip=None, dhcp=True, gateway=None, dns=None), 'packages': ['sudo', 'efibootmgr', 'qemu-guest-agent', 'iptables-nft', 'iotop', 'htop', 'ncdu', 'net-tools', 'openbsd-netcat', 'nfs-utils', 'bind', 'man-db', 'openssh', 'zsh', 'git', 'rsync', 'tmux', 'dos2unix', 'ripgrep', 'fd', 'jq', 'bat', 'neovim', 'entr', 'nomad', 'consul', 'podman', 'nomad-driver-podman', 'cni-plugins'], 'script': 'guided', 'services': ['consul', 'nomad', 'podman.socket', 'fstrim.timer', 'sshd'], 'sys-encoding': 'utf-8', 'sys-language': 'en_US', 'timezone': 'America/Chicago', 'version': '2.5.4', '!root-password': '********', '!users': [User(username='qubidt', password='********', sudo=True)], 'config': '/root/archinstall_configuration.json', 'creds': '/root/archinstall_credentials.json', 'disk_layouts': {'/dev/sda': {'partitions': [{'boot': True, 'encrypted': False, 'filesystem': {'format': 'fat32'}, 'mountpoint': '/boot', 'size': '512MiB', 'start': '1MiB', 'type': 'primary', 'wipe': True}, {'encrypted': False, 'filesystem': {'format': 'ext4'}, 'mountpoint': '/', 'size': '100%', 'start': '513MiB', 'type': 'primary', 'wipe': True}], 'wipe': True}, '/dev/sdb': {'partitions': [{'filesystem': {'format': 'ext4'}, 'mountpoint': '/var/lib/nomad/alloc', 'size': '100%', 'start': '1MiB', 'type': 'primary', 'wipe': True}]}, '/dev/sdc': {'partitions': [{'filesystem': {'format': 'ext4'}, 'mountpoint': '/var/lib/containers', 'size': '100%', 'start': '1MiB', 'type': 'primary', 'wipe': True}]}}, 'silent': False, 'dry_run': False, 'debug': False, 'offline': False, 'no_pkg_lookups': False, 'archinstall-language': Language(abbr='en', name_en='English', translation=<gettext.GNUTranslations object at 0x7f593f66ac80>, translation_percent=100, translated_lang=None), 'keyboard-layout': 'us', 'mirror-region': {}, 'disk_encryption': None, 'swap': True, 'hostname': 'archlinux', 'profile': None, 'audio': None, 'parallel downloads': 0, 'kernels': ['linux'], 'additional-repositories': [], 'ntp': True, '__separator__': None, 'save_config': None, 'install': None, 'abort': None}
```

notably: `..., 'disk_encryption': None, ...`

https://github.com/archlinux/archinstall/blob/4f539a193146b67e122d30732294df44eb826f13/archinstall/lib/configuration.py#L74C5-L75

Should probably have a `and self._config[key]` condition in that check, I think.


Discussion:
PR wanted

Resolving patch:
diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py
--- a/archinstall/lib/configuration.py
+++ b/archinstall/lib/configuration.py
@@ -71,7 +71,7 @@ def _process_config(self):
 			else:
 				self._user_config[key] = self._config[key]
 
-				if key == 'disk_encryption':  # special handling for encryption password
+				if key == 'disk_encryption' and self._config[key]:  # special handling for encryption password
 					self._user_credentials['encryption_password'] = self._config[key].encryption_password
 
 	def user_config_to_json(self) -> str:


Test patch: