Skip to content

Commit 89057c3

Browse files
committed
added check for empty env var
1 parent 68f6552 commit 89057c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

azure-vote/azure-vote/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
# Load configurations from environment or config file
1111
app.config.from_pyfile('config_file.cfg')
1212

13-
if "VOTE1VALUE" in os.environ:
13+
if ("VOTE1VALUE" in os.environ and os.environ['VOTE1VALUE']):
1414
button1 = os.environ['VOTE1VALUE']
1515
else:
1616
button1 = app.config['VOTE1VALUE']
1717

18-
if "VOTE2VALUE" in os.environ:
18+
if ("VOTE2VALUE" in os.environ and os.environ['VOTE2VALUE']):
1919
button2 = os.environ['VOTE2VALUE']
2020
else:
2121
button2 = app.config['VOTE2VALUE']
2222

23-
if "TITLE" in os.environ:
23+
if ("TITLE" in os.environ and os.environ['TITLE']):
2424
title = os.environ['TITLE']
2525
else:
2626
title = app.config['TITLE']

0 commit comments

Comments
 (0)