Commit 49b611bd authored by Curious Crook's avatar Curious Crook Committed by oroulet

Fix crash if server does not provide DiscoveryUrls

The OPC UA specification does not forbid that a server does not offer DiscoveryUrls. This can lead to a crash when calling the function application_to_strings().

Check DiscoveryUrls for None or empty before iterating to avoid the crash described in #1127.
parent fc09e423
...@@ -525,8 +525,9 @@ def application_to_strings(app): ...@@ -525,8 +525,9 @@ def application_to_strings(app):
for (n, v) in optionals: for (n, v) in optionals:
if v: if v:
result.append((n, v)) result.append((n, v))
for url in app.DiscoveryUrls: if app.DiscoveryUrls:
result.append(("Discovery URL", url)) for url in app.DiscoveryUrls:
result.append(("Discovery URL", url))
return result # ['{}: {}'.format(n, v) for (n, v) in result] return result # ['{}: {}'.format(n, v) for (n, v) in result]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment