Adding in import statements corresponding to a contributed library via Sketch>Import Library...>(contributed library) now adds in the correct import statement(s). The error was because of the relatively new specifiedImports field in the .properties file, which is blank for most library contributions at present. The import statements were getting read from here, and null was being returned only if the field was null. However, the field was being parsed and stored as an empty string if the field was not present/was blank, which caused an import statement of the form import (blank string).* to be added.
Ah, sorry about that. This happens because of the specifiedImports field in the library .properties file. It is a relatively new field, and is left blank in most of the contributed libraries, as a result of which a blank entry gets stored. I've now updated the commit to ensure that the blank entry be detected and treated as missing (stored as a null) during the initial parsing of the .properties file itself, instead of handling this check in the getSpecifiedImports() method like I had done till now.
The PR seems to be updated. The change was originally in getSpecifiedImports(), but is now in the correct location parseImports(). The fix itself is the same, however, just that it is now added at the correct place.
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.