From 7372fca0dd580125225e86416f0adcc9b466c09f Mon Sep 17 00:00:00 2001 From: JulioV Date: Mon, 8 Mar 2021 18:00:36 -0500 Subject: [PATCH] Fix bug when sensor is not available for an OS --- src/data/streams/pull_phone_data.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/streams/pull_phone_data.R b/src/data/streams/pull_phone_data.R index 898fbc01..c604b6f4 100644 --- a/src/data/streams/pull_phone_data.R +++ b/src/data/streams/pull_phone_data.R @@ -135,6 +135,10 @@ pull_phone_data <- function(){ message(paste0("\nProcessing ", sensor, " for ", device)) device_os <- ifelse(device_oss[idx] == "infer", infer_device_os_container(data_configuration, device), device_oss[idx]) validate_inferred_os(basename(stream_container), participant_file, device, device_os) + + if(!toupper(device_os) %in% stream_schema[[sensor]]) # the current sensor is only available in a single OS (like PHONE_MESSAGES) + next + os_table <- ifelse(length(tables) > 1, tables[[toupper(device_os)]], tables) # some sensor tables have a different name for android and ios columns_to_download <- stream_schema[[sensor]][[toupper(device_os)]][["COLUMN_MAPPINGS"]]