Browse Source

only look for parent landmark if it exists

Kylie Jo Swistak 5 years ago
parent
commit
6d80dd6fae
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/responses/landmark.rb

+ 1 - 1
app/responses/landmark.rb

@@ -15,7 +15,7 @@ def landmark_embed(lm:, user: nil, section: nil, event: nil)
               end
 
   r = Region.find(lm.region)
-  plm = Landmark.find(lm.location)
+  plm = Landmark.find(lm.location) if lm.location
   npcs = []
   npc_list = LandmarkNpcs.where(landmark_id: lm.id)
   npc_list.each do |lmnpc|