Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent crash on empty list #2113

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

sloanelybutsurely
Copy link
Contributor

@sloanelybutsurely sloanelybutsurely commented Jul 18, 2024

Refactors select_direction_and_route/1 to use pattern mattern more heavily and handle cases when the passed argument is an empty list.

This handles the case when the direction and route for the informed entities of an alert are empty or otherwise filtered down to an empty list (e.g. only contain JFK). Additionally this is perhaps slightly more idiomatic Elixir code.

Fixes SCREENS-AM

Refactors `select_direction_and_route/1` to use pattern mattern more
heavily and handle cases when the passed argument is an empty list.

This handles the case when the direction and route for the informed
entities of an alert are empty or otherwise filtered down to an empty
list (e.g. only contain JFK). Additionally this is perhaps slightly more
idiomatic Elixir code.
@sloanelybutsurely sloanelybutsurely requested a review from a team as a code owner July 18, 2024 18:17
Copy link

Coverage of commit c89d194

Summary coverage rate:
  lines......: 45.0% (2927 of 6499 lines)
  functions..: 41.2% (1044 of 2537 functions)
  branches...: no data found

Files changed coverage rate:
                                                                          |Lines       |Functions  |Branches    
  Filename                                                                |Rate     Num|Rate    Num|Rate     Num
  ==============================================================================================================
  lib/screens/v2/widget_instance/reconstructed_alert.ex                   |86.9%    335| 100%    45|    -      0

Download coverage report

@sloanelybutsurely sloanelybutsurely merged commit 24fb7a6 into main Jul 18, 2024
13 checks passed
@sloanelybutsurely sloanelybutsurely deleted the sloane/fix-hd-argument-error branch July 18, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants