diff options
| author | Ashfahan Khan <[email protected]> | 2019-06-17 11:00:36 +0500 |
|---|---|---|
| committer | Martijn Cuppens <[email protected]> | 2019-06-17 08:00:36 +0200 |
| commit | c5b1919deaf5393fcca9e9b9d7ce9c338160d99d (patch) | |
| tree | 5ed4f75bb843feea7b588010b3e6d85ca5d14768 | |
| parent | 0829decce075e190c0bb6e9992ca2a1ca56c60c7 (diff) | |
| download | bootstrap-c5b1919deaf5393fcca9e9b9d7ce9c338160d99d.tar.xz bootstrap-c5b1919deaf5393fcca9e9b9d7ce9c338160d99d.zip | |
Add Error checking to prevent invalid breakpoint (#28889)
* Add Error checking to prevent invalid breakpoint
Error checking to prevent invalid breakpoint name
* check type rather than value
* Revert "check type rather than value"
This reverts commit 04ab1e652f9c9c1c7725b7328b12f548a2c6d142.
* use of not rather than null
| -rw-r--r-- | scss/mixins/_breakpoints.scss | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scss/mixins/_breakpoints.scss b/scss/mixins/_breakpoints.scss index 23a5de96b..81f8ffb28 100644 --- a/scss/mixins/_breakpoints.scss +++ b/scss/mixins/_breakpoints.scss @@ -16,7 +16,10 @@ // md @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { $n: index($breakpoint-names, $name); - @return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null); + @if not $n { + @error "breakpoint `#{$name}` not found in `#{$breakpoints}`"; + } + @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null); } // Minimum breakpoint width. Null for the smallest (first) breakpoint. |
