From a6165af3fa2a3dd109decfda013dd15a5a479f13 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Mon, 23 Jan 2017 19:33:54 +0100 Subject: [PATCH] Guard against non-existing file when markdown previewing --- VimR/MarkdownRenderer.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VimR/MarkdownRenderer.swift b/VimR/MarkdownRenderer.swift index 4ca2f1df..c4f8bb6e 100644 --- a/VimR/MarkdownRenderer.swift +++ b/VimR/MarkdownRenderer.swift @@ -269,6 +269,10 @@ class MarkdownRenderer: NSObject, Flow, PreviewRenderer { return nil } + guard FileUtils.fileExists(at: url) else { + return nil + } + return url default: