Sephfox commited on
Commit
3a97d6d
·
verified ·
1 Parent(s): af2bcf4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -299,7 +299,11 @@ stop_button = st.button("Stop Simulation", on_click=stop_simulation)
299
  while True:
300
  try:
301
  fig = q.get(timeout=0.1)
302
- chart_placeholder.plotly_chart(fig, use_container_width=True)
 
 
 
 
303
  except queue.Empty:
304
  time.sleep(0.1)
305
  continue
 
299
  while True:
300
  try:
301
  fig = q.get(timeout=0.1)
302
+ if fig is not None:
303
+ chart_placeholder.plotly_chart(fig, use_container_width=True)
304
+ else:
305
+ print("Received None figure from queue. Stopping simulation.")
306
+ break
307
  except queue.Empty:
308
  time.sleep(0.1)
309
  continue