atom / settings-view

🔧 Edit Atom settings
MIT License
272 stars 276 forks source link

Prevent unhandled exception when packages is not iterable #1074

Open jeffatwork opened 6 years ago

jeffatwork commented 6 years ago

This happens consistently when installed on Windows 10 WSL with Ubuntu 18.04 from a clean install of Windows, WSL, and Atom.

Requirements

Description of the Change

With a virgin install, following the flight manual instructions of Atom on Windows 10 WSL Ubuntu 18.04, an unhandled exception occurs "TypeError: packages is not iterable".

This exception occurs when you click "Install a Package" -> Open Installer -> + Install

While I do not know why this error is occurring and the packages object is not properly instantiated to an iterable null set, the fix I provided simply ensures that object is iterable. If the object is not iterable, it returns and thus does not attempt the iteration loop.

Alternate Designs

No alternate designs were considered.

Benefits

Prevents unhandled exception and allows Atom to install new packages.

Possible Drawbacks

None, if the packages object is iterable, the original code operates as before. No logic changes have been introduced.

Applicable Issues

https://github.com/atom/atom/issues/17658