deal with empty option

stvnrlly 10 年之前
父节点
当前提交
09647798e7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/models/agents/user_location_agent.rb

+ 1 - 1
app/models/agents/user_location_agent.rb

@@ -73,7 +73,7 @@ module Agents
73 73
     def handle_payload(payload)
74 74
       location = Location.new(payload)
75 75
 
76
-      if (location.present? && (payload["accuracy"] < interpolated[:max_accuracy]))
76
+      if location.present? && (!interpolated[:max_accuracy].present? || payload["accuracy"] < interpolated[:max_accuracy])
77 77
         create_event payload: payload, location: location
78 78
       end
79 79
     end