Summary
Three low-frequency but real crash scenarios:
H8: pull(date_field) without data context when sample_date is NA
- File:
R/cansim.R:93 (approximate line)
- Issue: Falls back to
pull(date_field) without a data context
- Impact: Can error on edge cases
H9: view_cansim_webpage NULL check after lowercase
- File:
R/cansim.R:923 (approximate line)
- Issue: Lowercases input before checking for NULL, errors on length-0 input
- Impact: Edge case crash
M8: Potential NULL dereference in cache check
- File:
R/cansim_parquet.R:302 (approximate line)
- Issue:
is.na(last_downloaded) doesn't handle NULL/empty vector
- Impact: Crash on unexpected cache state
Proposed Fix
- H8: Add proper data context
- H9: Check NULL/length before lowercase
- M8: Check
is.null() || length() == 0 || is.na()
From code audit - low-frequency but real crash scenarios
Summary
Three low-frequency but real crash scenarios:
H8:
pull(date_field)without data context when sample_date is NAR/cansim.R:93(approximate line)pull(date_field)without a data contextH9:
view_cansim_webpageNULL check after lowercaseR/cansim.R:923(approximate line)M8: Potential NULL dereference in cache check
R/cansim_parquet.R:302(approximate line)is.na(last_downloaded)doesn't handle NULL/empty vectorProposed Fix
is.null() || length() == 0 || is.na()From code audit - low-frequency but real crash scenarios