diff options
Diffstat (limited to 'src/mbgl/map/transform.cpp')
-rw-r--r-- | src/mbgl/map/transform.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 9f3a2a83d2..20e29db6ac 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -406,10 +406,11 @@ double Transform::getZoom() const { #pragma mark - Bounds -void Transform::setLatLngBounds(const LatLngBounds& bounds) { - if (bounds.valid()) { - state.setLatLngBounds(bounds); +void Transform::setLatLngBounds(optional<LatLngBounds> bounds) { + if (bounds && !bounds->valid()) { + throw std::runtime_error("failed to set bounds: bounds are invalid"); } + state.setLatLngBounds(bounds); } void Transform::setMinZoom(const double minZoom) { |