From 6d81a91c73be2e6e6245f04a2fa4b5db6e05e324 Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Mon, 23 Dec 2013 11:37:19 -0800
Subject: [PATCH] Ignore errors when canonicalizing paths for automation

It's only being done to make the error reporting prettier, so it failing
shouldn't block the loading of the file.
---
 aegisub/src/auto4_lua_scriptreader.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/aegisub/src/auto4_lua_scriptreader.cpp b/aegisub/src/auto4_lua_scriptreader.cpp
index 08cc47144..8ee5be0f3 100644
--- a/aegisub/src/auto4_lua_scriptreader.cpp
+++ b/aegisub/src/auto4_lua_scriptreader.cpp
@@ -31,7 +31,13 @@
 
 namespace Automation4 {
 	bool LoadFile(lua_State *L, agi::fs::path const& raw_filename) {
-		auto filename = agi::fs::Canonicalize(raw_filename);
+		auto filename = raw_filename;
+		try {
+			filename = agi::fs::Canonicalize(raw_filename);
+		}
+		catch (agi::fs::FileSystemUnknownError const& e) {
+			LOG_E("auto4/lua") << "Error canonicalizing path: " << e.GetChainedMessage();
+		}
 
 		std::unique_ptr<std::istream> file(agi::io::Open(filename, true));
 		file->seekg(0, std::ios::end);
-- 
GitLab