Skip to content

Commit bc576f2

Browse files
committed
[manager] Alert user of an invalid backend name
1 parent f8effa4 commit bc576f2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/nacs-seq/manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ NACS_EXPORT() Manager::ExpSeq *Manager::create_sequence(const uint8_t *data, siz
311311
throw std::runtime_error("Invalid channel name.");
312312
add_debug_printf("Adding channel: %s\n", name.c_str());
313313
auto dev = expseq->get_device(name.substr(0, sep), true);
314+
if (!dev)
315+
throw std::runtime_error("Invalid device name.");
314316
auto chn_name = name.substr(sep + 1);
315317
assert(chn_name.size() == name_len - sep - 1);
316318
dev->add_channel(chn_id, chn_name);

0 commit comments

Comments
 (0)