From 3a1edfe2cea639c165808a35c3a3d17e88a8bf0c Mon Sep 17 00:00:00 2001 From: Aaron Oneal Date: Tue, 20 Aug 2013 17:26:19 -0700 Subject: Fix crash in macdoc ScrollToVisible is sometimes called on the previous node, and in some cases this previous node does not have a registered wrapper which causes macdoc to crash. This fix adds a check for the node instead of throwing. --- MyDocument.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MyDocument.cs b/MyDocument.cs index b7e624d..a46126b 100644 --- a/MyDocument.cs +++ b/MyDocument.cs @@ -514,6 +514,9 @@ namespace macdoc int ScrollToVisible (Node n) { + if (!nodeToWrapper.ContainsKey (n)) + return 0; + var item = nodeToWrapper [n]; var row = outlineView.RowForItem (item); outlineView.ScrollRowToVisible (row); -- cgit v1.2.3