private static bool IsDocumentValid(Document document) { try { if (document == null || string.IsNullOrEmpty(document.FullName) || !Path.IsPathRooted(document.FullName)) return false; } catch (Exception) { return false; } return true; }