Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Don't throw an error when trying to iterate on a null key #55

Merged
merged 3 commits into from
Apr 25, 2019

Conversation

farktronix
Copy link
Contributor

Iterating on an undefined variable causes an error. This code:

#for(item in context.allItems) {

Where context.allItems is not defined results in a confusing error message:

"Could not convert iterator data to array."

Vapor should allow iteration on undefined variables by doing nothing.

@farktronix
Copy link
Contributor Author

This should fix #12

@tanner0101 tanner0101 added the bug Something isn't working label Apr 25, 2019
@tanner0101 tanner0101 added this to In Progress in Vapor 3 via automation Apr 25, 2019
Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment, besides that LGTM, thanks :)

Sources/TemplateKit/Pipeline/TemplateSerializer.swift Outdated Show resolved Hide resolved
Copy link
Member

@tanner0101 tanner0101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tanner0101 tanner0101 merged commit 121ae51 into vapor:master Apr 25, 2019
@penny-coin
Copy link

Hey @farktronix, you just merged a pull request, have a coin!

You now have 1 coins.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
Vapor 3
  
In Progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants