From c7a6e8d886c96757ea9e6408979e6edd3076f49b Mon Sep 17 00:00:00 2001 From: Luke Page Date: Fri, 25 Sep 2015 12:39:24 +0100 Subject: [PATCH] Fix import inline. Fixes #2703 --- lib/less/tree/import.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/less/tree/import.js b/lib/less/tree/import.js index d604e6fd9..bcad7e5a8 100644 --- a/lib/less/tree/import.js +++ b/lib/less/tree/import.js @@ -128,7 +128,12 @@ Import.prototype.eval = function (context) { } if (this.options.inline) { - var contents = new Anonymous(this.root, 0, {filename: this.importedFilename, reference: this.path.currentFileInfo.reference}, true, true, false); + var contents = new Anonymous(this.root, 0, + { + filename: this.importedFilename, + reference: this.path.currentFileInfo && this.path.currentFileInfo.reference + }, true, true, false); + return this.features ? new Media([contents], this.features.value) : [contents]; } else if (this.css) { var newImport = new Import(this.evalPath(context), features, this.options, this.index);