Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Fix bug where incorrect radar imagery files could be returned
Browse files Browse the repository at this point in the history
If the `radar_id` in `get_available_radar()` is not numeric or not found in the database  it should produce an error.
  • Loading branch information
adamhsparks committed Dec 1, 2020
1 parent 7cbcbba commit 1e1f93d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/get_radar_imagery.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ get_available_radar <- function(radar_id = "all") {
)
if (radar_id[1] == "all") {
dat <- dat
} else if (as.numeric(radar_id) %in% dat$Radar_id) {
} else if (is.numeric(radar_id) && as.numeric(radar_id) %in% dat$Radar_id) {
dat <- dat[dat$Radar_id %in% as.numeric(radar_id), ]
} else{
stop("radar_id not found")
Expand Down

0 comments on commit 1e1f93d

Please sign in to comment.