From 7b3a1a7342ecddf6ca6e524af93aa5f4bc8c92ab Mon Sep 17 00:00:00 2001 From: Octavian Chelu Date: Tue, 19 Sep 2023 17:09:57 +0300 Subject: [PATCH] Fix TypeError: can only concatenate str (not "NoneType") to str --- python3/vdebug/dbgp.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python3/vdebug/dbgp.py b/python3/vdebug/dbgp.py index 053f018..416f378 100644 --- a/python3/vdebug/dbgp.py +++ b/python3/vdebug/dbgp.py @@ -533,16 +533,19 @@ def _determine_displayname(self, node): self.display_name = self.code else: if self.language == 'php': + name = node.get('name') + if not isinstance(name, str): + name = self._get_enc_node_text(node, 'name', "") if self.parent.type == 'array': - if node.get('name').isdigit(): + if name.isdigit(): self.display_name = self.parent.display_name + \ - "[%s]" % node.get('name') + "[%s]" % name else: self.display_name = self.parent.display_name + \ - "['%s']" % node.get('name') + "['%s']" % name else: self.display_name = self.parent.display_name + \ - "->" + node.get('name') + "->" + name elif self.language == 'perl': self.display_name = node.get('fullname') else: