Browse Source

Updated length check.

master
- 6 months ago
parent
commit
c6ff21e9dc
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      duniter-alert.py

+ 6
- 2
duniter-alert.py View File

@@ -130,8 +130,12 @@ else: # invoke from OBS
global app
app = obs.obs_data_get_string(settings, "append")
obs.timer_remove(update_text)
if address != "" and len(address) == 44 and src != "":
obs.timer_add(update_text, interval * 1000)
if address != "" and src != "":
if len(address) == 43 or len(address) == 44:
obs.timer_add(update_text, interval * 1000)
else:
obs.script_log(obs.LOG_WARNING, "Warning: Given address is either too short or too long to be a Duniter address. No timer instantiated.")


def script_defaults(settings):
obs.obs_data_set_default_string(settings, "peer", "https://g1.duniter.org")

Loading…
Cancel
Save