Skip to content

Commit 6218225

Browse files
committed
fix port listing crash when a port is removed during the listing
1 parent 1db027c commit 6218225

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/jack.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,17 @@ def _port_list_from_pointers(self, names):
17731773
name = names[idx]
17741774
if not name:
17751775
break
1776-
ports.append(self.get_port_by_name(_decode(name)))
1776+
1777+
port_ptr = _lib.jack_port_by_name(self._ptr, name)
1778+
if not port_ptr:
1779+
continue
1780+
1781+
try:
1782+
port = self._wrap_port_ptr(port_ptr)
1783+
except AssertionError:
1784+
continue
1785+
1786+
ports.append(port)
17771787
idx += 1
17781788
return ports
17791789

0 commit comments

Comments
 (0)