This commit is contained in:
Cleon 2023-01-06 11:04:00 +13:00
parent 3f8aaf2610
commit 00d77f8f37
2 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ export default class MeldBuildPlugin extends Plugin {
//await view.save();
const compiler = new Compiler();
const runner = compiler.compile(logger, editor, view);
runner();
runner?.();
}catch(e){
console.debug('here');
await logger.error(e);

View file

@ -12,12 +12,12 @@ import { IoRunContextImplemention } from "./rci-io";
export class Compiler{
public compile( logger: RunLogger, editor: Editor, view: MarkdownView ) : () => void {
public compile( logger: RunLogger, editor: Editor, view: MarkdownView ) : (() => void) | null {
const fileCache = app.metadataCache.getFileCache(view.file);
if (fileCache == null){
return () => {};
return null;
}
// build context