diff options
author | Aaron Oneal <aaron.oneal@spicypixel.com> | 2013-08-21 04:26:19 +0400 |
---|---|---|
committer | Aaron Oneal <aaron.oneal@spicypixel.com> | 2013-08-21 04:27:23 +0400 |
commit | 3a1edfe2cea639c165808a35c3a3d17e88a8bf0c (patch) | |
tree | c8ad8c8bd85c457ee85ba28c7a2559f2f6a16446 | |
parent | eab22f0e69b7168631b63b1469005fe5b3ee13cb (diff) |
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.
-rw-r--r-- | MyDocument.cs | 3 |
1 files changed, 3 insertions, 0 deletions
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); |