From 8ece891c1a29a3d09f8791d68e9f190e75c7315c Mon Sep 17 00:00:00 2001 From: figment Date: Wed, 8 Feb 2012 20:13:59 -0800 Subject: [PATCH] - Fix null pointer exception when editing a records with no subrecords - Various recordstructure.xml updates - Fix issue with duplicates in navigation history --- ObjectControls/PluginTreeView.cs | 10 ++++-- ObjectControls/SubrecordListEditor.cs | 1 + README.TXT | 5 +++ build/buildver.txt | 2 +- conf/RecordStructure.xml | 46 +++++++++++++++------------ 5 files changed, 40 insertions(+), 24 deletions(-) diff --git a/ObjectControls/PluginTreeView.cs b/ObjectControls/PluginTreeView.cs index 068e3a5..4821eac 100644 --- a/ObjectControls/PluginTreeView.cs +++ b/ObjectControls/PluginTreeView.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -520,8 +521,13 @@ private void PluginTree_SizeChanged(object sender, EventArgs e) private void PluginTree_SelectedIndexChanged(object sender, EventArgs e) { - if (_historyHandler.CurrentItem != PluginTree.SelectedRecord) - _historyHandler.CurrentItem = PluginTree.SelectedRecord; + if (PluginTree.SelectedRecord != null) + { + if (_historyHandler.CurrentItem == null && !PluginTree.SelectedRecord.Equals(_historyHandler.CurrentItem)) + { + _historyHandler.CurrentItem = PluginTree.SelectedRecord; + } + } RebuildSelection(); } diff --git a/ObjectControls/SubrecordListEditor.cs b/ObjectControls/SubrecordListEditor.cs index 5a1d05e..ac2bc10 100644 --- a/ObjectControls/SubrecordListEditor.cs +++ b/ObjectControls/SubrecordListEditor.cs @@ -541,6 +541,7 @@ public void EditSelectedSubrecord() else if (!Properties.Settings.Default.UseHexSubRecordEditor && sr.Structure != null && sr.Structure.elements != null + && sr.Structure.elements.Length > 0 && sr.Structure.elements[0].type != ElementValueType.Blob && !sr.Structure.UseHexEditor) { Form re; diff --git a/README.TXT b/README.TXT index 8a5264e..a7635ea 100644 --- a/README.TXT +++ b/README.TXT @@ -9,6 +9,11 @@ Requirements: .NET 3.5 Change Log: +v 4.2 +- Fix null pointer exception when editing a records with no subrecords +- Various recordstructure.xml updates +- Fix issue with duplicates in navigation history + v 4.1 - Fixed issues with MGEF (signed vs unsigned values) - Added Copy & "Copy To" to search window diff --git a/build/buildver.txt b/build/buildver.txt index 5f11626..1e60f56 100644 --- a/build/buildver.txt +++ b/build/buildver.txt @@ -1 +1 @@ -4.1.4418.3 \ No newline at end of file +4.2.4421.0 \ No newline at end of file diff --git a/conf/RecordStructure.xml b/conf/RecordStructure.xml index 53c7c5b..beb302f 100644 --- a/conf/RecordStructure.xml +++ b/conf/RecordStructure.xml @@ -540,14 +540,14 @@ - - - - - - - - + + + + + + + + @@ -4078,7 +4078,7 @@ - + @@ -4454,11 +4454,15 @@ - - + + + + + + + - @@ -4985,15 +4989,15 @@ - - - - - - - - - + + + + + + + + +