vapor / leaf-kit

🍃 An expressive, performant, and extensible templating language built for Swift.
https://docs.vapor.codes/4.0/leaf/getting-started
MIT License
49 stars 38 forks source link

Fix crash with missing parameter #130

Closed b-nassler closed 7 months ago

b-nassler commented 8 months ago

These changes are now available in 1.10.5

This line https://github.com/vapor/leaf-kit/blob/main/Sources/LeafKit/LeafParser/LeafParser.swift#L203 would cause a crash when no parameters are found

Fixed issue that lead to a crash when parameters would be empty in line https://github.com/vapor/leaf-kit/blob/main/Sources/LeafKit/LeafParser/LeafParser.swift#L203

gwynne commented 8 months ago

Oh, I forgot to also add - can you add a test for this as well?

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 82.09%. Comparing base (38e3144) to head (750db9d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #130 +/- ## ========================================== - Coverage 82.15% 82.09% -0.07% ========================================== Files 25 25 Lines 2595 2603 +8 ========================================== + Hits 2132 2137 +5 - Misses 463 466 +3 ``` | [Files](https://app.codecov.io/gh/vapor/leaf-kit/pull/130?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor) | Coverage Δ | | |---|---|---| | [Sources/LeafKit/LeafParser/LeafParser.swift](https://app.codecov.io/gh/vapor/leaf-kit/pull/130?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vapor#diff-U291cmNlcy9MZWFmS2l0L0xlYWZQYXJzZXIvTGVhZlBhcnNlci5zd2lmdA==) | `94.05% <83.33%> (-0.91%)` | :arrow_down: |
b-nassler commented 8 months ago

@gwynne Updated, please check 🙂

b-nassler commented 7 months ago

@gwynne @0xTim Everything should be ok I think. Let me know if I should do anything else. Thanks!

b-nassler commented 7 months ago

@gwynne Good one! I committed your suggestion

b-nassler commented 7 months ago

@0xTim You probably saw this but something ran out of memory so it didn't succeed merging