SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

Source Mapping generation shouldn't be done if Link Source Map is set to false and Inline is set to false #281

Closed SeabassNg closed 9 years ago

SeabassNg commented 9 years ago

Currently, I'm getting a null pointer exception due to source map generation and fails the entire compilation process despite turning all of source map options off. Please don't run the source map generation code if all options are off.

SomMeri commented 9 years ago

I will fix this next week.

SeabassNg commented 9 years ago

Any updates?

SomMeri commented 9 years ago

@SeabassNg Apologies for saying a week, I should have said a month. I will release right after I fix this which I hope will be in next few days.

SeabassNg commented 9 years ago

Thanks for the reply

SomMeri commented 9 years ago

I just tried to reproduce the error, but failed. Could you please give me stack trace of that null pointer exception?

This is how I configured the compiler:

    Configuration configuration = new Configuration();
    configuration.setCssResultLocation(new LessSource.FileSource(cssOutput));
    configuration.getSourceMapConfiguration().setInline(false);
    configuration.getSourceMapConfiguration().setLinkSourceMap(false);
    return configuration;

Are you doing something differently?

SeabassNg commented 9 years ago

The exception showed up when I was using the Thread Unsafe Compiler and multiple threads were running together. I switched over to the Thread Safe Compiler and it worked.

As for the configuration, I set the link source map to false, but it still went over the source map code. It just didn't add it to the file.

SomMeri commented 9 years ago

I will close the issue then.