From a531f70890228f6ff22622ed6dccdbc1398150be Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 10:07:49 -0700 Subject: [PATCH] fix(dbc): skip non-array rows in loadJSON instead of failing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A JSON DBC with a malformed record (object instead of array, or a string entry) would call row[col] which throws on non-arrays — the outer try-catch treated this as a hard failure for the whole DBC. Skip the row (stays zero-initialized) so a single malformed record doesn't lose all the rest. --- src/pipeline/dbc_loader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pipeline/dbc_loader.cpp b/src/pipeline/dbc_loader.cpp index c839853e..e4cb9629 100644 --- a/src/pipeline/dbc_loader.cpp +++ b/src/pipeline/dbc_loader.cpp @@ -441,6 +441,11 @@ bool DBCFile::loadJSON(const std::vector& jsonData) { for (uint32_t i = 0; i < recordCount; i++) { const auto& row = records[i]; + // Skip non-array rows (object, string, etc.) — row[col] throws + // on a non-array, which the outer try-catch would treat as a + // hard load failure for the whole file. Empty record stays + // zero-initialized from the resize() above. + if (!row.is_array()) continue; uint32_t* fields = reinterpret_cast( recordData.data() + static_cast(i) * recordSize);