mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 08:00:24 +08:00
Prevent invalid LESS from crashing application
Failure is silent for now... The default LESS will compile without the invalid customisations. Not sure if we should log an error somewhere and display it on the admin page? closes #400
This commit is contained in:
parent
478ca90c31
commit
6ee9412f35
|
@ -11,6 +11,7 @@
|
|||
namespace Flarum\Assets;
|
||||
|
||||
use Less_Parser;
|
||||
use Less_Exception_Parser;
|
||||
|
||||
class LessCompiler extends RevisionCompiler
|
||||
{
|
||||
|
@ -28,7 +29,11 @@ class LessCompiler extends RevisionCompiler
|
|||
}
|
||||
|
||||
foreach ($this->strings as $callback) {
|
||||
$parser->parse($callback());
|
||||
try {
|
||||
$parser->parse($callback());
|
||||
} catch (Less_Exception_Parser $e) {
|
||||
// TODO: log an error somewhere?
|
||||
}
|
||||
}
|
||||
|
||||
return $parser->getCss();
|
||||
|
|
Loading…
Reference in New Issue
Block a user