Protect the sensor log request if we don't have a database handle ready