More cleanup.
[kiosk.git] / stevens_renderer.py
index 6d8768ee387a12ecd50dfb68471bb2d8d97c27ef..bba06030b90e7924327f5238ebc8bf0f3e2957be 100644 (file)
@@ -43,13 +43,16 @@ class stevens_pass_conditions_renderer(renderer.debuggable_abstaining_renderer):
                             for x in item.getchildren():
                                 if x.tag == "description":
                                     text = x.text
-                                    text = text.replace(
-                                        "<strong>Stevens Pass US2</strong><br/>", ""
-                                    )
-                                    text = text.replace("<br/><br/>", "<BR>")
-                                    text = text.replace(
-                                        "<strong>Elevation Meters:</strong>1238<BR>", ""
-                                    )
-                                    f.write("<P>\n%s\n" % text)
+                                    if text is not None:
+                                        text = text.replace(
+                                            "<strong>Stevens Pass US2</strong><br/>", ""
+                                        )
+                                        text = text.replace("<br/><br/>", "<BR>")
+                                        text = text.replace(
+                                            "<strong>Elevation Meters:</strong>1238<BR>", ""
+                                        )
+                                    else:
+                                        text = ""
+                                    f.write(f"<P>\n{text}\n")
                     return True
         return False