diff options
author | Neale Ranns <neale.ranns@cisco.com> | 2017-11-25 02:52:06 -0800 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-11-25 18:03:44 +0000 |
commit | 020df9a7a55ebf9e06db3f24982efe5fdd68ebb9 (patch) | |
tree | 41522ed36518e34ae038052b40c408ca613a2bf1 /src/vpp-api | |
parent | d29319632ae02029a606316f483dc064b71bd147 (diff) |
VOM: handle null for iterator in dump cmd
Change-Id: I2e8743d70a8d8604d370218a73d5f37c2f7c4617
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api')
-rw-r--r-- | src/vpp-api/vom/dump_cmd.hpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/vpp-api/vom/dump_cmd.hpp b/src/vpp-api/vom/dump_cmd.hpp index cc255ac0daf..72fcdf55746 100644 --- a/src/vpp-api/vom/dump_cmd.hpp +++ b/src/vpp-api/vom/dump_cmd.hpp @@ -62,9 +62,28 @@ public: */ virtual ~dump_cmd() {} - const_iterator begin() { return (m_dump->get_result_set().begin()); } + /** + * Constant iterator to the start of the records retunred during the dump + */ + const_iterator begin() + { + /* + * m_dump is NULL during client UT when the commands are not issued. + */ + if (!m_dump) + return const_iterator(); + return (m_dump->get_result_set().begin()); + } - const_iterator end() { return (m_dump->get_result_set().end()); } + /** + * Constant iterator to the end of the records retunred during the dump + */ + const_iterator end() + { + if (!m_dump) + return const_iterator(); + return (m_dump->get_result_set().end()); + } /** * Wait for the issue of the command to complete |