Skip to content

Commit 9e0a38e

Browse files
Fixes #1006 - handling invalid input source maps.
1 parent 913d72c commit 9e0a38e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

History.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Fixed issue [#988](https://github.com/jakubpawlowicz/clean-css/issues/988) - edge case in dropping default animation-duration.
55
* Fixed issue [#989](https://github.com/jakubpawlowicz/clean-css/issues/989) - edge case in removing unused at rules.
66
* Fixed issue [#1001](https://github.com/jakubpawlowicz/clean-css/issues/1001) - corrupted tokenizer state.
7+
* Fixed issue [#1006](https://github.com/jakubpawlowicz/clean-css/issues/1006) - edge case in handling invalid source maps.
78
* Fixed issue [#1008](https://github.com/jakubpawlowicz/clean-css/issues/1008) - edge case in breaking up `font` shorthand.
89

910
[4.1.9 / 2017-09-19](https://github.com/jakubpawlowicz/clean-css/compare/v4.1.8...v4.1.9)

lib/reader/input-source-map-tracker.js

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ function originalPositionFor(maps, metadata, range, selectorFallbacks) {
3434
originalPosition = maps[source].originalPositionFor(position);
3535
}
3636

37+
if (!originalPosition || originalPosition.column < 0) {
38+
return metadata;
39+
}
40+
3741
if (originalPosition.line === null && line > 1 && selectorFallbacks > 0) {
3842
return originalPositionFor(maps, [line - 1, column, source], range, selectorFallbacks - 1);
3943
}

0 commit comments

Comments
 (0)