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,6 +525,7 @@ def application_to_strings(app):
for (n, v) in optionals:
if v:
result.append((n, v))
if app.DiscoveryUrls:
for url in app.DiscoveryUrls:
result.append(("Discovery URL", url))
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