Skip to content

Commit

Permalink
multipage: use get() as it's safer than bracket indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
nouraellm committed Oct 11, 2022
1 parent a77d4b7 commit faa4883
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions multipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def run(self):
page = st.sidebar.selectbox(
'App Navigation',
self.pages,
format_func=lambda page: page['title']
format_func=lambda page: page.get('title', "")
)

# run the app function
page['function']()
page.get('function')()

0 comments on commit faa4883

Please sign in to comment.