Skip to content

Commit

Permalink
Fix DDSLS tool by catching nullptrs returning from entity naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsmie committed May 10, 2022
1 parent 672f459 commit 43e9b2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cyclonedds/qos.py
Expand Up @@ -1994,6 +1994,12 @@ def _get_p_entityname(cls, qos):
if not cls._get_entity_name(qos, ct.byref(cls._gc_prop_get_value)):
return None

if cls._gc_prop_get_value is None or cls._gc_prop_get_value.value is None:
return None

if type(cls._gc_prop_get_value.value) != bytes:
return None

name = cls._gc_prop_get_value.value.decode('utf8')
cls.free(cls._gc_prop_get_value)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_ddsls.py
Expand Up @@ -460,7 +460,7 @@ async def test_inner():
await asyncio.sleep(1)
return disposed_data

procdata, disposed_data = run_ddsls_watchmode(["--json", "-a", "-w", "--filename", str(tmp_path / "test_disposed.json")],
procdata, disposed_data = run_ddsls_watchmode(["--json", "-a", "--filename", str(tmp_path / "test_disposed.json")],
test_inner, runtime=2)

assert procdata['status'] == 0
Expand Down

0 comments on commit 43e9b2c

Please sign in to comment.