diff options
author | Roshan Pius <rpius@google.com> | 2017-03-10 21:12:11 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-03-11 05:41:59 +0000 |
commit | 78cfef9f0c03a1b11c987ef165133bc3ae2d8b9c (patch) | |
tree | 1be6507fd057a09a02a2e18c0a9a04ff97f2d806 /wifi/1.0/default/hidl_struct_util.cpp | |
parent | 4f4fdaf664d708061d804edceb7c80f0851b7243 (diff) |
wifi(implementation): Add null checks for RTT result
According to the legacy HAL header file, the LCI & LCR fields may not
always be populated. So, add null checks for them.
Bug: 36141536
Test: Compiles
Change-Id: Id2a5f5fd0eaf21b3a4d5cfcd26124c9fb6c90869
Diffstat (limited to 'wifi/1.0/default/hidl_struct_util.cpp')
-rw-r--r-- | wifi/1.0/default/hidl_struct_util.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp index 98a62bf013..a89f8c0492 100644 --- a/wifi/1.0/default/hidl_struct_util.cpp +++ b/wifi/1.0/default/hidl_struct_util.cpp @@ -1898,10 +1898,12 @@ bool convertLegacyRttResultToHidl( hidl_result->timeStampInUs = legacy_result.ts; hidl_result->burstDurationInMs = legacy_result.burst_duration; hidl_result->negotiatedBurstNum = legacy_result.negotiated_burst_num; - if (!convertLegacyIeToHidl(*legacy_result.LCI, &hidl_result->lci)) { + if (legacy_result.LCI && !convertLegacyIeToHidl(*legacy_result.LCI, + &hidl_result->lci)) { return false; } - if (!convertLegacyIeToHidl(*legacy_result.LCR, &hidl_result->lcr)) { + if (legacy_result.LCR && !convertLegacyIeToHidl(*legacy_result.LCR, + &hidl_result->lcr)) { return false; } return true; |