This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Prevent unhandled exception when packages is not iterable #1074
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
atom/atom#17658