Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
eernstg
left a comment
There was a problem hiding this comment.
Thanks @StuartSharpless, this looks good to me!
@sigurdm, could you take a look as well?
|
@StuartSharpless, the 'contributor license agreement' needs to be in place in order to land this PR. If you're OK with that then please check out the 'Details' in the 'cla/google' item above. Otherwise I can just create a new PR to do the same thing. |
|
@eernstg I think I have now completed the CIA it shows successful for me. I thought I had before as well :-) |
|
It's such a basic thing to check that a list isn't empty before accessing the first element in it, so it's kind of surprising that this bug could exist for years and years without being detected. However, it does make sense that it wouldn't happen often: The empty list can only be encountered in a situation where the reflectable code generator is invoked on an entry point that has no imports (and no exports, etc, but "no imports" is the one that matters), and this implies that the run would fail very soon after: The code generator bails out if the program (all libraries reachable from the entry point) doesn't include |
Fix, if you want it, for issue 354 Exception in _getLibraryMetadata while running reflectable_builder
Just adding the length check for the directives list.