ErfanRMZP commited on
Commit
197d07f
·
verified ·
1 Parent(s): 81cbae0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -122,13 +122,17 @@ if results is None:
122
  st.info("Enter a route to begin.")
123
  st.stop()
124
 
125
- # If backend returned an error
 
 
 
126
  if "error" in results:
127
  st.error(results["error"])
128
  if "details" in results:
129
  st.code(results["details"])
130
  st.stop()
131
 
 
132
  # ---------------------------------------------------
133
  # Map Rendering + Summary Side-by-Side
134
  # ---------------------------------------------------
 
122
  st.info("Enter a route to begin.")
123
  st.stop()
124
 
125
+ if not isinstance(results, dict):
126
+ st.error("Unexpected backend response.")
127
+ st.stop()
128
+
129
  if "error" in results:
130
  st.error(results["error"])
131
  if "details" in results:
132
  st.code(results["details"])
133
  st.stop()
134
 
135
+
136
  # ---------------------------------------------------
137
  # Map Rendering + Summary Side-by-Side
138
  # ---------------------------------------------------