From 7fdf6e79a2263a89019b9d207539918f82f02fca Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sun, 7 Jun 2020 09:40:19 -0400 Subject: [PATCH] properly throw ObjectModelNotSupported instead of just silently failing --- .../DataFormats/Chunked/RIFF/RIFFDataFormat.cs | 2 +- .../UniversalPropertyListDataFormat.cs | 4 ++-- .../DataFormats/AddressBook/WABDataFormat.cs | 2 +- .../DataFormats/AniMiku/AnimatedTexture/AMTDataFormat.cs | 4 ++-- .../AniMiku/PMDExtension/PMDExtensionDataFormat.cs | 2 +- .../FileSystem/ChaosWorks/ChaosWorksVOLDataFormat.cs | 5 ++--- .../DataFormats/FileSystem/ALTools/EGG/EGGDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/AR/ARDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/ARC/ARCDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/ARJ/ARJDataFormat.cs | 4 ++-- .../FileSystem/BPlus/BPlusFileSystemDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/Box/BoxDataFormat.cs | 4 ++-- .../BurikoGeneralInterpreter/BurikoARCDataFormat.cs | 3 ++- .../FileSystem/ElectronicArts/BIGFDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/FFS/FFSDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/FSB/FSBDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/GCD/GCDDataFormat.cs | 2 +- .../DataFormats/FileSystem/GPW/GPWDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/Hardball/MB6DataFormat.cs | 4 ++-- .../FileSystem/Homeworld/HomeworldDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/HostileWaters/DATDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/HostileWaters/MNGDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/HyPack/HyPackDataFormat.cs | 2 +- .../FileSystem/JackOrlando/JackOrlandoDataFormat.cs | 4 +++- .../DataFormats/FileSystem/JadeEmpire/RIMDataFormat.cs | 3 ++- .../DataFormats/FileSystem/Nero/NeroDiskImageDataFormat.cs | 2 +- .../DataFormats/FileSystem/Nvidia/NPK/NPKDataFormat.cs | 2 +- .../DataFormats/FileSystem/PCK/PCKDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/PRF/PRFDataFormat.cs | 2 +- .../FileSystem/REEVEsoft/Freeze/ICEDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/SPIS/SPISDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/SevenZip/SevenZipDataFormat.cs | 2 +- .../DataFormats/FileSystem/TLCD/TLCDDataFormat.cs | 2 +- .../FileSystem/UUEncoding/UUEncodingDataFormat.cs | 2 +- .../DataFormats/FileSystem/Ultra3D/Ultra3DRBXDataFormat.cs | 4 ++-- .../DataFormats/FileSystem/ZIP/ZIPDataFormat.cs | 4 ++-- .../DataFormats/Icarus/IcarusTextDataFormat.cs | 4 ++-- .../FileSystem/InstallShield/Cabinet/CABDataFormat.cs | 4 ++-- .../FileSystem/InstallShield/PKG/PKGDataFormat.cs | 4 ++-- .../Microsoft/MSCompressed/MSCompressedDataFormat.cs | 2 +- .../Palette/PaintShop/PaintShopPaletteDataFormat.cs | 2 +- .../DataFormats/Multimedia/Picture/ARGB/ARGBDataFormat.cs | 4 ++-- .../DataFormats/Multimedia/Picture/I16/I16DataFormat.cs | 2 +- .../DataFormats/Multimedia/Picture/LEAD/CMPDataFormat.cs | 2 +- .../Multimedia/Picture/PortablePixelmap/PPMDataFormat.cs | 2 +- .../Picture/WaveletScalarQuantization/WSQDataFormat.cs | 2 +- .../Accessory/PolygonMovieMaker/VACAccessoryDataFormat.cs | 4 ++-- .../DataFormats/Multimedia3D/Model/GLB/GLBDataFormat.cs | 5 ++++- .../Multimedia3D/Model/Inivis/AC3DDataFormat.cs | 4 ++-- .../Model/PolygonMovieMaker/PMDModelDataFormat.cs | 2 +- .../Model/PolygonMovieMaker/PMXModelDataFormat.cs | 5 ++++- .../DataFormats/Multimedia3D/Model/Quake/GLMDataFormat.cs | 2 +- .../DataFormats/Multimedia3D/Model/Quake/MD3DataFormat.cs | 7 +++++-- .../Multimedia3D/Model/SMD/SMDBaseDataFormat.cs | 2 +- .../Multimedia3D/Model/TriangleEditor/TEDDataFormat.cs | 2 +- .../Motion/MotionVectorData/MVDMotionDataFormat.cs | 2 +- .../Motion/PolygonMovieMaker/VMDMotionDataFormat.cs | 4 ++-- .../Scene/PolygonMovieMaker/PMMSceneDataFormat.cs | 2 +- .../DataFormats/PMAXPatch/PMAXPatchBinaryDataFormat.cs | 4 ++-- .../Multimedia3D/Model/PMAModelObjectModelExtension.cs | 2 +- .../FileSystem/NewWorldComputing/AGG/AGGDataFormat.cs | 4 ++-- .../FileSystem/NewWorldComputing/Heroes3SNDDataFormat.cs | 4 ++-- .../FileSystem/NewWorldComputing/Heroes3VIDDataFormat.cs | 4 ++-- .../NewWorldComputing/LOD/Heroes3LODDataFormat.cs | 4 ++-- .../NewWorldComputing/LOD/Magic6LODDataFormat.cs | 2 +- .../Picture/NewWorldComputing/BMP/BMPDataFormat.cs | 2 +- .../Picture/NewWorldComputing/ICN/ICNDataFormat.cs | 2 +- .../DataFormats/NewWorldComputing/CC/CCDataFormat.cs | 2 +- .../NewWorldComputing/Heroes2/Heroes2MapDataFormat.cs | 3 +-- .../DataFormats/FileSystem/Sega/FARC/FARCDataFormat.cs | 2 +- .../ObjectModels/SourceCode/CodeObjectModel.cs | 2 +- .../VersatileContainer/VersatileContainerV2DataFormat.cs | 4 ++-- .../DataFormats/Text/MHTML/MHTMLDataFormat.cs | 2 +- 73 files changed, 122 insertions(+), 111 deletions(-) diff --git a/Libraries/UniversalEditor.Essential/DataFormats/Chunked/RIFF/RIFFDataFormat.cs b/Libraries/UniversalEditor.Essential/DataFormats/Chunked/RIFF/RIFFDataFormat.cs index 6c40780b..fa5badad 100644 --- a/Libraries/UniversalEditor.Essential/DataFormats/Chunked/RIFF/RIFFDataFormat.cs +++ b/Libraries/UniversalEditor.Essential/DataFormats/Chunked/RIFF/RIFFDataFormat.cs @@ -169,7 +169,7 @@ namespace UniversalEditor.DataFormats.Chunked.RIFF protected override void SaveInternal(ObjectModel objectModel) { ChunkedObjectModel riff = (objectModel as ChunkedObjectModel); - if (riff == null) return; + if (riff == null) throw new ObjectModelNotSupportedException(); Writer bw = base.Accessor.Writer; diff --git a/Libraries/UniversalEditor.Essential/DataFormats/PropertyList/UniversalPropertyList/UniversalPropertyListDataFormat.cs b/Libraries/UniversalEditor.Essential/DataFormats/PropertyList/UniversalPropertyList/UniversalPropertyListDataFormat.cs index 39c708cf..6807282e 100644 --- a/Libraries/UniversalEditor.Essential/DataFormats/PropertyList/UniversalPropertyList/UniversalPropertyListDataFormat.cs +++ b/Libraries/UniversalEditor.Essential/DataFormats/PropertyList/UniversalPropertyList/UniversalPropertyListDataFormat.cs @@ -55,7 +55,7 @@ namespace UniversalEditor.DataFormats.PropertyList.UniversalPropertyList protected override void LoadInternal(ref ObjectModel objectModel) { PropertyListObjectModel plom = (objectModel as PropertyListObjectModel); - if (plom == null) return; + if (plom == null) throw new ObjectModelNotSupportedException(); Reader br = base.Accessor.Reader; string UPLF = br.ReadFixedLengthString(4); @@ -251,7 +251,7 @@ namespace UniversalEditor.DataFormats.PropertyList.UniversalPropertyList protected override void SaveInternal(ObjectModel objectModel) { PropertyListObjectModel plom = (objectModel as PropertyListObjectModel); - if (plom == null) return; + if (plom == null) throw new ObjectModelNotSupportedException(); Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("UPLF"); diff --git a/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/AddressBook/WABDataFormat.cs b/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/AddressBook/WABDataFormat.cs index e6d2eae8..fa50e472 100644 --- a/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/AddressBook/WABDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.AddressBook/DataFormats/AddressBook/WABDataFormat.cs @@ -34,7 +34,7 @@ namespace UniversalEditor.DataFormats.AddressBook protected override void LoadInternal(ref ObjectModel objectModel) { AddressBookObjectModel ab = (objectModel as AddressBookObjectModel); - if (ab == null) return; + if (ab == null) throw new ObjectModelNotSupportedException(); Reader br = base.Accessor.Reader; diff --git a/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/AnimatedTexture/AMTDataFormat.cs b/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/AnimatedTexture/AMTDataFormat.cs index 65d6e3c8..25fdc576 100644 --- a/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/AnimatedTexture/AMTDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/AnimatedTexture/AMTDataFormat.cs @@ -41,7 +41,7 @@ namespace UniversalEditor.DataFormats.FileSystem.AniMiku.TexturePackage protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; int unknown = br.ReadInt32(); @@ -56,7 +56,7 @@ namespace UniversalEditor.DataFormats.FileSystem.AniMiku.TexturePackage protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; int unknown = 150; diff --git a/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/PMDExtension/PMDExtensionDataFormat.cs b/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/PMDExtension/PMDExtensionDataFormat.cs index d65bb3fd..e78e4603 100644 --- a/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/PMDExtension/PMDExtensionDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.AniMiku/DataFormats/AniMiku/PMDExtension/PMDExtensionDataFormat.cs @@ -49,7 +49,7 @@ namespace UniversalEditor.DataFormats.AniMiku.PMDExtension protected override void LoadInternal(ref ObjectModel objectModel) { PMDExtensionObjectModel pmdo = (objectModel as PMDExtensionObjectModel); - if (pmdo == null) return; + if (pmdo == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; foreach (ModelMaterial mat in mvarModel.Materials) diff --git a/Plugins/UniversalEditor.Plugins.ChaosWorks/DataFormats/FileSystem/ChaosWorks/ChaosWorksVOLDataFormat.cs b/Plugins/UniversalEditor.Plugins.ChaosWorks/DataFormats/FileSystem/ChaosWorks/ChaosWorksVOLDataFormat.cs index 3d31145d..16cd390b 100644 --- a/Plugins/UniversalEditor.Plugins.ChaosWorks/DataFormats/FileSystem/ChaosWorks/ChaosWorksVOLDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.ChaosWorks/DataFormats/FileSystem/ChaosWorks/ChaosWorksVOLDataFormat.cs @@ -62,7 +62,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ChaosWorks protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); fsom.AdditionalDetails.Add("ChaosWorks.VOL.Label", "Label"); @@ -292,8 +292,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ChaosWorks protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) - throw new ObjectModelNotSupportedException(); + if (fsom == null) throw new ObjectModelNotSupportedException(); switch (FormatVersion) { diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ALTools/EGG/EGGDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ALTools/EGG/EGGDataFormat.cs index 18a2c67a..7c3b798e 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ALTools/EGG/EGGDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ALTools/EGG/EGGDataFormat.cs @@ -49,7 +49,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ALTools.EGG protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; br.Accessor.Position = 0; @@ -268,7 +268,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ALTools.EGG protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AR/ARDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AR/ARDataFormat.cs index fdf4545d..37553ae4 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AR/ARDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/AR/ARDataFormat.cs @@ -46,7 +46,7 @@ namespace UniversalEditor.DataFormats.FileSystem.AR protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader reader = base.Accessor.Reader; string sig_arch = reader.ReadFixedLengthString(7); @@ -113,7 +113,7 @@ namespace UniversalEditor.DataFormats.FileSystem.AR protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("!"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs index 71761996..8709ad56 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARC/ARCDataFormat.cs @@ -41,7 +41,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ARC protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; br.Endianness = IO.Endianness.LittleEndian; @@ -91,7 +91,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ARC protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteByte((byte)0x1a); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs index cb596106..e5cfb1ff 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ARJ/ARJDataFormat.cs @@ -49,7 +49,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ARJ protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; @@ -186,7 +186,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ARJ protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteUInt16(0xEA60); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BPlus/BPlusFileSystemDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BPlus/BPlusFileSystemDataFormat.cs index c229a474..6c623074 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BPlus/BPlusFileSystemDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BPlus/BPlusFileSystemDataFormat.cs @@ -50,7 +50,7 @@ namespace UniversalEditor.DataFormats.FileSystem.BPlus protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; @@ -196,7 +196,7 @@ namespace UniversalEditor.DataFormats.FileSystem.BPlus protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer _bw = base.Accessor.Writer; #region Header diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Box/BoxDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Box/BoxDataFormat.cs index 9d01d91f..15c5655c 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Box/BoxDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Box/BoxDataFormat.cs @@ -113,7 +113,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Box protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader brf = base.Accessor.Reader; IO.Reader br = brf; @@ -166,7 +166,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Box protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BurikoGeneralInterpreter/BurikoARCDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BurikoGeneralInterpreter/BurikoARCDataFormat.cs index 1f51d653..aa2d0927 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BurikoGeneralInterpreter/BurikoARCDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/BurikoGeneralInterpreter/BurikoARCDataFormat.cs @@ -45,7 +45,7 @@ namespace UniversalEditor.DataFormats.FileSystem.BurikoGeneralInterpreter protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string PackFile____ = br.ReadFixedLengthString(12); @@ -75,6 +75,7 @@ namespace UniversalEditor.DataFormats.FileSystem.BurikoGeneralInterpreter protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("PackFile "); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ElectronicArts/BIGFDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ElectronicArts/BIGFDataFormat.cs index f8d0cc7f..06e96e03 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ElectronicArts/BIGFDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ElectronicArts/BIGFDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ElectronicArts protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string header = br.ReadFixedLengthString(4); @@ -72,7 +72,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ElectronicArts protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("BIGF"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FFS/FFSDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FFS/FFSDataFormat.cs index 239e6c5e..319ad1b2 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FFS/FFSDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FFS/FFSDataFormat.cs @@ -42,7 +42,7 @@ namespace UniversalEditor.DataFormats.FileSystem.FFS protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string FFS_ = br.ReadFixedLengthString(4); @@ -91,7 +91,7 @@ namespace UniversalEditor.DataFormats.FileSystem.FFS protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("FFS "); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FSB/FSBDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FSB/FSBDataFormat.cs index 66453e29..5d0ae809 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FSB/FSBDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/FSB/FSBDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.FileSystem.FSB protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string header = br.ReadFixedLengthString(4); @@ -89,7 +89,7 @@ namespace UniversalEditor.DataFormats.FileSystem.FSB protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("FSB3"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GCD/GCDDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GCD/GCDDataFormat.cs index 80f381e8..5896d42b 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GCD/GCDDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GCD/GCDDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.FileSystem.GCD protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GPW/GPWDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GPW/GPWDataFormat.cs index e169f616..5291ed18 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GPW/GPWDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/GPW/GPWDataFormat.cs @@ -41,7 +41,7 @@ namespace UniversalEditor.DataFormats.FileSystem.GPW protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; @@ -56,7 +56,7 @@ namespace UniversalEditor.DataFormats.FileSystem.GPW protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Hardball/MB6DataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Hardball/MB6DataFormat.cs index 1a5c4648..e3286262 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Hardball/MB6DataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Hardball/MB6DataFormat.cs @@ -41,7 +41,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Hardball protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string MB6_ = br.ReadFixedLengthString(4); @@ -93,7 +93,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Hardball protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("MB6\0"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs index 28df08c1..3bed04f0 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Homeworld/HomeworldDataFormat.cs @@ -49,7 +49,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Homeworld protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string header = br.ReadFixedLengthString(4); @@ -81,7 +81,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Homeworld protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; if (mvarVersion >= 1) diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/DATDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/DATDataFormat.cs index 635ae341..aa7f9528 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/DATDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/DATDataFormat.cs @@ -52,7 +52,7 @@ namespace UniversalEditor.DataFormats.FileSystem.HostileWaters protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); if (!(base.Accessor is FileAccessor) && MBXFileName == null) throw new InvalidOperationException("Requires a file reference or known MBX file path"); @@ -82,7 +82,7 @@ namespace UniversalEditor.DataFormats.FileSystem.HostileWaters protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteUInt32((uint)fsom.Files.Count); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/MNGDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/MNGDataFormat.cs index f81abbd1..3b23018e 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/MNGDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HostileWaters/MNGDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.FileSystem.HostileWaters protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; uint fileCount = br.ReadUInt32(); @@ -87,7 +87,7 @@ namespace UniversalEditor.DataFormats.FileSystem.HostileWaters protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteUInt32((uint)fsom.Files.Count); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HyPack/HyPackDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HyPack/HyPackDataFormat.cs index e7fc2d61..5b40bcce 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HyPack/HyPackDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/HyPack/HyPackDataFormat.cs @@ -42,7 +42,7 @@ namespace UniversalEditor.DataFormats.FileSystem.HyPack protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string HyPack = br.ReadFixedLengthString(6); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs index 82b0bd8f..468ae326 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JackOrlando/JackOrlandoDataFormat.cs @@ -42,7 +42,7 @@ namespace UniversalEditor.DataFormats.FileSystem.JackOrlando protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string PAK = br.ReadFixedLengthString(4); @@ -86,6 +86,8 @@ namespace UniversalEditor.DataFormats.FileSystem.JackOrlando protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); + if (fsom == null) throw new ObjectModelNotSupportedException(); + IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("PAK\0"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JadeEmpire/RIMDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JadeEmpire/RIMDataFormat.cs index 5360f122..40306776 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JadeEmpire/RIMDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/JadeEmpire/RIMDataFormat.cs @@ -48,6 +48,7 @@ namespace UniversalEditor.DataFormats.FileSystem.JadeEmpire protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string header = br.ReadFixedLengthString(8); @@ -99,7 +100,7 @@ namespace UniversalEditor.DataFormats.FileSystem.JadeEmpire protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("RIM V1.0"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nero/NeroDiskImageDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nero/NeroDiskImageDataFormat.cs index 000e2e7d..a39b59bb 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nero/NeroDiskImageDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nero/NeroDiskImageDataFormat.cs @@ -47,7 +47,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Nero protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nvidia/NPK/NPKDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nvidia/NPK/NPKDataFormat.cs index cf66383a..8a0584a5 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nvidia/NPK/NPKDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Nvidia/NPK/NPKDataFormat.cs @@ -57,7 +57,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Nvidia.NPK protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; br.Accessor.Position = 0; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PCK/PCKDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PCK/PCKDataFormat.cs index 0ce5e10e..cf26aef7 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PCK/PCKDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PCK/PCKDataFormat.cs @@ -62,7 +62,7 @@ namespace UniversalEditor.DataFormats.FileSystem.PCK protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string signature = br.ReadFixedLengthString(4); @@ -106,7 +106,7 @@ namespace UniversalEditor.DataFormats.FileSystem.PCK protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("2NBF"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PRF/PRFDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PRF/PRFDataFormat.cs index e2802cc7..a886dd07 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PRF/PRFDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/PRF/PRFDataFormat.cs @@ -50,7 +50,7 @@ namespace UniversalEditor.DataFormats.FileSystem.PRF protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; Version = br.ReadUInt32(); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/REEVEsoft/Freeze/ICEDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/REEVEsoft/Freeze/ICEDataFormat.cs index 6e91b72e..bc310ec7 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/REEVEsoft/Freeze/ICEDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/REEVEsoft/Freeze/ICEDataFormat.cs @@ -52,7 +52,7 @@ namespace UniversalEditor.DataFormats.FileSystem.REEVEsoft.Freeze protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string signature = br.ReadFixedLengthString(2); @@ -110,7 +110,7 @@ namespace UniversalEditor.DataFormats.FileSystem.REEVEsoft.Freeze protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("FR"); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SPIS/SPISDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SPIS/SPISDataFormat.cs index be9c66d0..6e06c4cc 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SPIS/SPISDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SPIS/SPISDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.FileSystem.SPIS protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; while (!br.EndOfStream) @@ -80,7 +80,7 @@ namespace UniversalEditor.DataFormats.FileSystem.SPIS protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; foreach (File file in fsom.Files) diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SevenZip/SevenZipDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SevenZip/SevenZipDataFormat.cs index b112e092..ea31ddba 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SevenZip/SevenZipDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/SevenZip/SevenZipDataFormat.cs @@ -46,7 +46,7 @@ namespace UniversalEditor.DataFormats.FileSystem.SevenZip protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; br.Accessor.Position = 0; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/TLCD/TLCDDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/TLCD/TLCDDataFormat.cs index 09c82ae2..e7fd1df0 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/TLCD/TLCDDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/TLCD/TLCDDataFormat.cs @@ -46,7 +46,7 @@ namespace UniversalEditor.DataFormats.FileSystem.TLCD protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Reader br = base.Accessor.Reader; string tagTLCD = br.ReadFixedLengthString(4); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/UUEncoding/UUEncodingDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/UUEncoding/UUEncodingDataFormat.cs index b9363280..6cd814b8 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/UUEncoding/UUEncodingDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/UUEncoding/UUEncodingDataFormat.cs @@ -118,7 +118,7 @@ namespace UniversalEditor.DataFormats.FileSystem.UUEncoding protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader tr = base.Accessor.Reader; diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Ultra3D/Ultra3DRBXDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Ultra3D/Ultra3DRBXDataFormat.cs index 1bd2b16e..0fbc6606 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Ultra3D/Ultra3DRBXDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/Ultra3D/Ultra3DRBXDataFormat.cs @@ -42,7 +42,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Ultra3D protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; @@ -87,7 +87,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Ultra3D protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteInt32(0x0BA99A9E); diff --git a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ZIP/ZIPDataFormat.cs b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ZIP/ZIPDataFormat.cs index 692636d8..675e5b64 100644 --- a/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ZIP/ZIPDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.FileSystem/DataFormats/FileSystem/ZIP/ZIPDataFormat.cs @@ -67,7 +67,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ZIP protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; @@ -386,7 +386,7 @@ namespace UniversalEditor.DataFormats.FileSystem.ZIP protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Dictionary relativeOffsetsOfLocalHeaders = new Dictionary(); diff --git a/Plugins/UniversalEditor.Plugins.Icarus/DataFormats/Icarus/IcarusTextDataFormat.cs b/Plugins/UniversalEditor.Plugins.Icarus/DataFormats/Icarus/IcarusTextDataFormat.cs index 50442b7c..21f6945e 100644 --- a/Plugins/UniversalEditor.Plugins.Icarus/DataFormats/Icarus/IcarusTextDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Icarus/DataFormats/Icarus/IcarusTextDataFormat.cs @@ -48,7 +48,7 @@ namespace UniversalEditor.DataFormats.Icarus protected override void LoadInternal(ref ObjectModel objectModel) { IcarusScriptObjectModel script = (objectModel as IcarusScriptObjectModel); - if (script == null) return; + if (script == null) throw new ObjectModelNotSupportedException(); Reader reader = Accessor.Reader; @@ -179,7 +179,7 @@ namespace UniversalEditor.DataFormats.Icarus protected override void SaveInternal(ObjectModel objectModel) { IcarusScriptObjectModel script = (objectModel as IcarusScriptObjectModel); - if (script == null) return; + if (script == null) throw new ObjectModelNotSupportedException(); Writer tw = base.Accessor.Writer; tw.WriteLine("//Generated by BehavEd"); diff --git a/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/Cabinet/CABDataFormat.cs b/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/Cabinet/CABDataFormat.cs index 876c0088..e9fc8598 100644 --- a/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/Cabinet/CABDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/Cabinet/CABDataFormat.cs @@ -56,7 +56,7 @@ namespace UniversalEditor.DataFormats.FileSystem.InstallShield.Cabinet protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Reader br = Accessor.Reader; br.Accessor.Seek(0, SeekOrigin.Begin); @@ -137,7 +137,7 @@ namespace UniversalEditor.DataFormats.FileSystem.InstallShield.Cabinet protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("ISc("); diff --git a/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/PKG/PKGDataFormat.cs b/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/PKG/PKGDataFormat.cs index 433375b8..d3ce889f 100644 --- a/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/PKG/PKGDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.InstallShield/DataFormats/FileSystem/InstallShield/PKG/PKGDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.FileSystem.InstallShield.PKG protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Reader br = Accessor.Reader; ushort signature = br.ReadUInt16(); @@ -86,7 +86,7 @@ namespace UniversalEditor.DataFormats.FileSystem.InstallShield.PKG protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Writer bw = Accessor.Writer; bw.WriteUInt16(0xA34A); diff --git a/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/FileSystem/Microsoft/MSCompressed/MSCompressedDataFormat.cs b/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/FileSystem/Microsoft/MSCompressed/MSCompressedDataFormat.cs index 783048f5..220b5d9c 100644 --- a/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/FileSystem/Microsoft/MSCompressed/MSCompressedDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Microsoft/DataFormats/FileSystem/Microsoft/MSCompressed/MSCompressedDataFormat.cs @@ -48,7 +48,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Microsoft.MSCompressed protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs index 12fe07e1..acc2bd07 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Palette/PaintShop/PaintShopPaletteDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Palette.PaintShop protected override void LoadInternal(ref ObjectModel objectModel) { PaletteObjectModel palette = (objectModel as PaletteObjectModel); - if (palette == null) return; + if (palette == null) throw new ObjectModelNotSupportedException(); IO.Reader tr = base.Accessor.Reader; string signature = tr.ReadLine(); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/ARGB/ARGBDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/ARGB/ARGBDataFormat.cs index a62e277f..6dddcfff 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/ARGB/ARGBDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/ARGB/ARGBDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.ARGB protected override void LoadInternal(ref ObjectModel objectModel) { PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string signature = br.ReadFixedLengthString(4); @@ -73,7 +73,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.ARGB protected override void SaveInternal(ObjectModel objectModel) { PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("BGRA"); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/I16/I16DataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/I16/I16DataFormat.cs index 9644fc51..0af64465 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/I16/I16DataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/I16/I16DataFormat.cs @@ -46,7 +46,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.I16 protected override void LoadInternal(ref ObjectModel objectModel) { PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; ushort u1 = br.ReadUInt16(); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/LEAD/CMPDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/LEAD/CMPDataFormat.cs index cf40c407..bb3f3f04 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/LEAD/CMPDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/LEAD/CMPDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.LEAD protected override void LoadInternal(ref ObjectModel objectModel) { PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string LEAD = br.ReadFixedLengthString(4); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/PortablePixelmap/PPMDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/PortablePixelmap/PPMDataFormat.cs index f79c4b48..7b1c69ca 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/PortablePixelmap/PPMDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/PortablePixelmap/PPMDataFormat.cs @@ -46,7 +46,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.PortablePixelmap protected override void LoadInternal(ref ObjectModel objectModel) { PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string signature = br.ReadFixedLengthString(2); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/WaveletScalarQuantization/WSQDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/WaveletScalarQuantization/WSQDataFormat.cs index 5c2b7d3b..937db12c 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/WaveletScalarQuantization/WSQDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia/DataFormats/Multimedia/Picture/WaveletScalarQuantization/WSQDataFormat.cs @@ -927,7 +927,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.WaveletScalarQuantizati { IO.Reader br = base.Accessor.Reader; PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); br.Endianness = IO.Endianness.BigEndian; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Accessory/PolygonMovieMaker/VACAccessoryDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Accessory/PolygonMovieMaker/VACAccessoryDataFormat.cs index 3c40db7c..9e7c7d94 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Accessory/PolygonMovieMaker/VACAccessoryDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Accessory/PolygonMovieMaker/VACAccessoryDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Accessory.PolygonMovieMaker protected override void LoadInternal(ref ObjectModel objectModel) { AccessoryObjectModel accs = (objectModel as AccessoryObjectModel); - if (accs == null) return; + if (accs == null) throw new ObjectModelNotSupportedException(); base.Accessor.DefaultEncoding = Encoding.ShiftJIS; Reader tr = new Reader(base.Accessor); @@ -104,7 +104,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Accessory.PolygonMovieMaker protected override void SaveInternal(ObjectModel objectModel) { AccessoryObjectModel accs = (objectModel as AccessoryObjectModel); - if (accs == null) return; + if (accs == null) throw new ObjectModelNotSupportedException(); base.Accessor.DefaultEncoding = Encoding.ShiftJIS; Writer tw = new Writer(base.Accessor); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/GLB/GLBDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/GLB/GLBDataFormat.cs index 5da9a6a7..08b7102c 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/GLB/GLBDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/GLB/GLBDataFormat.cs @@ -60,7 +60,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.GLB protected override void LoadInternal(ref ObjectModel objectModel) { ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string magic = br.ReadFixedLengthString(4); // "\0GLB" @@ -141,6 +141,9 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.GLB } protected override void SaveInternal(ObjectModel objectModel) { + ModelObjectModel model = (objectModel as ModelObjectModel); + if (model == null) throw new ObjectModelNotSupportedException(); + IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("\0GLB"); bw.WriteInt32((int)ObjectType); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Inivis/AC3DDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Inivis/AC3DDataFormat.cs index efa7b82b..ffd86a64 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Inivis/AC3DDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Inivis/AC3DDataFormat.cs @@ -42,14 +42,14 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.Inivis protected override void LoadInternal(ref ObjectModel objectModel) { ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); } protected override void SaveInternal(ObjectModel objectModel) { ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); IO.Writer tw = base.Accessor.Writer; tw.WriteLine("AC3Db"); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMDModelDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMDModelDataFormat.cs index 02ca3ea1..4f5999c1 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMDModelDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMDModelDataFormat.cs @@ -64,7 +64,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.PolygonMovieMaker protected override void LoadInternal(ref ObjectModel objectModel) { ModelObjectModel model = objectModel as ModelObjectModel; - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string PMDKey = br.ReadFixedLengthString(3); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMXModelDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMXModelDataFormat.cs index e087b177..a560847e 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMXModelDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/PolygonMovieMaker/PMXModelDataFormat.cs @@ -55,7 +55,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.PolygonMovieMaker protected override void LoadInternal(ref ObjectModel objectModel) { ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string PMDKey = br.ReadFixedLengthString(4); @@ -1182,6 +1182,9 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.PolygonMovieMaker } protected override void SaveInternal(ObjectModel objectModel) { + ModelObjectModel model = (objectModel as ModelObjectModel); + if (model == null) throw new ObjectModelNotSupportedException(); + } } } diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/GLMDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/GLMDataFormat.cs index 981981fe..7e361f0b 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/GLMDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/GLMDataFormat.cs @@ -41,7 +41,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.Quake IO.Reader br = base.Accessor.Reader; ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); string signature = br.ReadFixedLengthString(4); if (signature != "2LGM") throw new InvalidDataFormatException("File does not begin with '2LGM'"); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/MD3DataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/MD3DataFormat.cs index 1c8cd3e6..f418e127 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/MD3DataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/Quake/MD3DataFormat.cs @@ -54,7 +54,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.Quake protected override void LoadInternal(ref ObjectModel objectModel) { ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); Reader br = base.Accessor.Reader; string IDP3 = br.ReadFixedLengthString(4); @@ -302,8 +302,11 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.Quake protected override void SaveInternal(ObjectModel objectModel) { - Writer bw = base.Accessor.Writer; ModelObjectModel model = objectModel as ModelObjectModel; + if (model == null) throw new ObjectModelNotSupportedException(); + + Writer bw = base.Accessor.Writer; + bw.WriteFixedLengthString("IDP3"); bw.WriteInt32(Version); string modelTitle = String.Empty; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/SMD/SMDBaseDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/SMD/SMDBaseDataFormat.cs index 9ced7cb7..df937e19 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/SMD/SMDBaseDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/SMD/SMDBaseDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.SMD protected override void LoadInternal(ref ObjectModel objectModel) { SMDObjectModel smd = (objectModel as SMDObjectModel); - if (smd == null) return; + if (smd == null) throw new ObjectModelNotSupportedException(); IO.Reader tr = base.Accessor.Reader; string version = tr.ReadLine(); diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/TriangleEditor/TEDDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/TriangleEditor/TEDDataFormat.cs index de4b216e..ce3f6b22 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/TriangleEditor/TEDDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Model/TriangleEditor/TEDDataFormat.cs @@ -46,7 +46,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Model.TriangleEditor protected override void LoadInternal(ref ObjectModel objectModel) { ModelObjectModel model = (objectModel as ModelObjectModel); - if (model == null) return; + if (model == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/MotionVectorData/MVDMotionDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/MotionVectorData/MVDMotionDataFormat.cs index 96a5db14..c7de474e 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/MotionVectorData/MVDMotionDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/MotionVectorData/MVDMotionDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Motion.MotionVectorData protected override void LoadInternal(ref ObjectModel objectModel) { MotionObjectModel motion = (objectModel as MotionObjectModel); - if (motion == null) return; + if (motion == null) throw new ObjectModelNotSupportedException(); System.Text.Encoding encoding = System.Text.Encoding.UTF8; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/PolygonMovieMaker/VMDMotionDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/PolygonMovieMaker/VMDMotionDataFormat.cs index 91649fe8..d9ecd25d 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/PolygonMovieMaker/VMDMotionDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Motion/PolygonMovieMaker/VMDMotionDataFormat.cs @@ -50,7 +50,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Motion.PolygonMovieMaker protected override void LoadInternal(ref ObjectModel objectModel) { MotionObjectModel motion = (objectModel as MotionObjectModel); - if (motion == null) return; + if (motion == null) throw new ObjectModelNotSupportedException(); base.Accessor.DefaultEncoding = Encoding.ShiftJIS; Reader br = base.Accessor.Reader; @@ -325,7 +325,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Motion.PolygonMovieMaker protected override void SaveInternal(ObjectModel objectModel) { MotionObjectModel motion = (objectModel as MotionObjectModel); - if (motion == null) return; + if (motion == null) throw new ObjectModelNotSupportedException(); base.Accessor.DefaultEncoding = Encoding.ShiftJIS; Writer bw = base.Accessor.Writer; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Scene/PolygonMovieMaker/PMMSceneDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Scene/PolygonMovieMaker/PMMSceneDataFormat.cs index c35c922f..156d8a57 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Scene/PolygonMovieMaker/PMMSceneDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/Multimedia3D/Scene/PolygonMovieMaker/PMMSceneDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.Multimedia3D.Scene.PolygonMovieMaker protected override void LoadInternal(ref ObjectModel objectModel) { SceneObjectModel som = (objectModel as SceneObjectModel); - if (som == null) return; + if (som == null) throw new ObjectModelNotSupportedException(); Reader br = base.Accessor.Reader; Encoding encoding = Encoding.ShiftJIS; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/PMAXPatch/PMAXPatchBinaryDataFormat.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/PMAXPatch/PMAXPatchBinaryDataFormat.cs index 7b480c24..96c4a87e 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/PMAXPatch/PMAXPatchBinaryDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/DataFormats/PMAXPatch/PMAXPatchBinaryDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.PMAXPatch protected override void LoadInternal(ref ObjectModel objectModel) { PMAXPatchObjectModel patches = (objectModel as PMAXPatchObjectModel); - if (patches == null) return; + if (patches == null) throw new ObjectModelNotSupportedException(); UniversalEditor.ObjectModels.PMAXPatch.PMAXPatch patch = new UniversalEditor.ObjectModels.PMAXPatch.PMAXPatch(); @@ -95,7 +95,7 @@ namespace UniversalEditor.DataFormats.PMAXPatch protected override void SaveInternal(ObjectModel objectModel) { PMAXPatchObjectModel patches = (objectModel as PMAXPatchObjectModel); - if (patches == null) return; + if (patches == null) throw new ObjectModelNotSupportedException(); if (patches.Patches.Count < 1) return; UniversalEditor.ObjectModels.PMAXPatch.PMAXPatch patch = patches.Patches[0]; diff --git a/Plugins/UniversalEditor.Plugins.Multimedia3D/ObjectModelExtensions/Multimedia3D/Model/PMAModelObjectModelExtension.cs b/Plugins/UniversalEditor.Plugins.Multimedia3D/ObjectModelExtensions/Multimedia3D/Model/PMAModelObjectModelExtension.cs index 977307cf..6faf5b35 100644 --- a/Plugins/UniversalEditor.Plugins.Multimedia3D/ObjectModelExtensions/Multimedia3D/Model/PMAModelObjectModelExtension.cs +++ b/Plugins/UniversalEditor.Plugins.Multimedia3D/ObjectModelExtensions/Multimedia3D/Model/PMAModelObjectModelExtension.cs @@ -38,7 +38,7 @@ namespace UniversalEditor.ObjectModelExtensions.Multimedia3D.Model public override void CopyTo(ObjectModelExtension where) { PMAModelObjectModelExtension clone = (where as PMAModelObjectModelExtension); - if (clone == null) return; + if (clone == null) throw new ObjectModelNotSupportedException(); clone.Enabled = mvarEnabled; clone.Version = (mvarVersion.Clone() as Version); diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/AGG/AGGDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/AGG/AGGDataFormat.cs index 7c207e2c..e2000319 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/AGG/AGGDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/AGG/AGGDataFormat.cs @@ -51,7 +51,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing.AGG protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; ushort fileCount = br.ReadUInt16(); @@ -101,7 +101,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing.AGG protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; ushort fileCount = (ushort)fsom.Files.Count; diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3SNDDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3SNDDataFormat.cs index cf8eec18..b383d48b 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3SNDDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3SNDDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader reader = base.Accessor.Reader; uint fileCount = reader.ReadUInt32(); @@ -86,7 +86,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); } } diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3VIDDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3VIDDataFormat.cs index 2f6ce50e..e5766a4a 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3VIDDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/Heroes3VIDDataFormat.cs @@ -43,7 +43,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader reader = base.Accessor.Reader; uint fileCount = reader.ReadUInt32(); @@ -76,7 +76,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; File[] files = fsom.GetAllFiles(); diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Heroes3LODDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Heroes3LODDataFormat.cs index 3aee4a79..2fb0fabb 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Heroes3LODDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Heroes3LODDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing.LOD protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader reader = base.Accessor.Reader; string magic = reader.ReadFixedLengthString(4); // LOD\0 @@ -100,7 +100,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing.LOD protected override void SaveInternal(ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteFixedLengthString("LOD\0"); diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Magic6LODDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Magic6LODDataFormat.cs index 0fc31c4b..2b16d4da 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Magic6LODDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/FileSystem/NewWorldComputing/LOD/Magic6LODDataFormat.cs @@ -36,7 +36,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing.LOD protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader reader = base.Accessor.Reader; string magic = reader.ReadFixedLengthString(4); // LOD\0 diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/BMP/BMPDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/BMP/BMPDataFormat.cs index 59367b34..4d15f617 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/BMP/BMPDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/BMP/BMPDataFormat.cs @@ -44,7 +44,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.NewWorldComputing.BMP protected override void LoadInternal(ref ObjectModel objectModel) { PictureObjectModel pic = (objectModel as PictureObjectModel); - if (pic == null) return; + if (pic == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; br.Accessor.Position = 0; diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs index a3f66f8d..4ddcbbfa 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/Multimedia/Picture/NewWorldComputing/ICN/ICNDataFormat.cs @@ -157,7 +157,7 @@ namespace UniversalEditor.DataFormats.Multimedia.Picture.NewWorldComputing.ICN { PictureCollectionObjectModel coll = (objectModel as PictureCollectionObjectModel); PictureObjectModel picret = (objectModel as PictureObjectModel); - if (coll == null && picret == null) return; + if (coll == null && picret == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; #region header diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/CC/CCDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/CC/CCDataFormat.cs index a89bf864..774f3ecb 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/CC/CCDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/CC/CCDataFormat.cs @@ -147,7 +147,7 @@ namespace UniversalEditor.DataFormats.FileSystem.NewWorldComputing.CC protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; ushort filecount = br.ReadUInt16(); diff --git a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/WorldMap2D/NewWorldComputing/Heroes2/Heroes2MapDataFormat.cs b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/WorldMap2D/NewWorldComputing/Heroes2/Heroes2MapDataFormat.cs index 7606b068..99225cbc 100644 --- a/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/WorldMap2D/NewWorldComputing/Heroes2/Heroes2MapDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.NewWorldComputing/DataFormats/NewWorldComputing/WorldMap2D/NewWorldComputing/Heroes2/Heroes2MapDataFormat.cs @@ -45,8 +45,7 @@ namespace UniversalEditor.DataFormats.NewWorldComputing.WorldMap2D.NewWorldCompu protected override void LoadInternal(ref ObjectModel objectModel) { MapObjectModel map = (objectModel as MapObjectModel); - if (map == null) return; - + if (map == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; uint magic = br.ReadUInt32(); diff --git a/Plugins/UniversalEditor.Plugins.Sega/DataFormats/FileSystem/Sega/FARC/FARCDataFormat.cs b/Plugins/UniversalEditor.Plugins.Sega/DataFormats/FileSystem/Sega/FARC/FARCDataFormat.cs index ecdfc5c6..c10ba599 100644 --- a/Plugins/UniversalEditor.Plugins.Sega/DataFormats/FileSystem/Sega/FARC/FARCDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Sega/DataFormats/FileSystem/Sega/FARC/FARCDataFormat.cs @@ -88,7 +88,7 @@ namespace UniversalEditor.Plugins.Sega.DataFormats.FileSystem.Sega.FARC protected override void LoadInternal(ref ObjectModel objectModel) { FileSystemObjectModel fsom = (objectModel as FileSystemObjectModel); - if (fsom == null) return; + if (fsom == null) throw new ObjectModelNotSupportedException(); Reader reader = base.Accessor.Reader; reader.Endianness = IO.Endianness.BigEndian; diff --git a/Plugins/UniversalEditor.Plugins.SoftwareDevelopment/ObjectModels/SourceCode/CodeObjectModel.cs b/Plugins/UniversalEditor.Plugins.SoftwareDevelopment/ObjectModels/SourceCode/CodeObjectModel.cs index 85951641..7e8e3088 100644 --- a/Plugins/UniversalEditor.Plugins.SoftwareDevelopment/ObjectModels/SourceCode/CodeObjectModel.cs +++ b/Plugins/UniversalEditor.Plugins.SoftwareDevelopment/ObjectModels/SourceCode/CodeObjectModel.cs @@ -51,7 +51,7 @@ namespace UniversalEditor.ObjectModels.SourceCode public override void CopyTo(ObjectModel destination) { CodeObjectModel clone = (destination as CodeObjectModel); - if (clone == null) return; + if (clone == null) throw new ObjectModelNotSupportedException(); foreach (CodeElement element in mvarElements) { diff --git a/Plugins/UniversalEditor.Plugins.VersatileContainer/DataFormats/VersatileContainer/VersatileContainerV2DataFormat.cs b/Plugins/UniversalEditor.Plugins.VersatileContainer/DataFormats/VersatileContainer/VersatileContainerV2DataFormat.cs index 0d1cf3a0..e6c9d98c 100644 --- a/Plugins/UniversalEditor.Plugins.VersatileContainer/DataFormats/VersatileContainer/VersatileContainerV2DataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.VersatileContainer/DataFormats/VersatileContainer/VersatileContainerV2DataFormat.cs @@ -28,7 +28,7 @@ namespace UniversalEditor.DataFormats.VersatileContainer protected override void LoadInternal(ref ObjectModel objectModel) { VersatileContainerObjectModel vcom = (objectModel as VersatileContainerObjectModel); - if (vcom == null) return; + if (vcom == null) throw new ObjectModelNotSupportedException(); IO.Reader br = base.Accessor.Reader; string signature = br.ReadFixedLengthString(30); // Versatile Container file 0002 @@ -125,7 +125,7 @@ namespace UniversalEditor.DataFormats.VersatileContainer protected override void SaveInternal(ObjectModel objectModel) { VersatileContainerObjectModel vcom = (objectModel as VersatileContainerObjectModel); - if (vcom == null) return; + if (vcom == null) throw new ObjectModelNotSupportedException(); IO.Writer bw = base.Accessor.Writer; bw.WriteNullTerminatedString("Versatile Container file 0002"); diff --git a/Plugins/UniversalEditor.Plugins.Web/DataFormats/Text/MHTML/MHTMLDataFormat.cs b/Plugins/UniversalEditor.Plugins.Web/DataFormats/Text/MHTML/MHTMLDataFormat.cs index 36e28e62..6a2a5ea3 100644 --- a/Plugins/UniversalEditor.Plugins.Web/DataFormats/Text/MHTML/MHTMLDataFormat.cs +++ b/Plugins/UniversalEditor.Plugins.Web/DataFormats/Text/MHTML/MHTMLDataFormat.cs @@ -82,7 +82,7 @@ namespace UniversalEditor.DataFormats.Text.MHTML protected override void LoadInternal(ref ObjectModel objectModel) { PlainTextObjectModel text = (objectModel as PlainTextObjectModel); - if (text == null) return; + if (text == null) throw new ObjectModelNotSupportedException(); Reader tr = base.Accessor.Reader; string content = String.Empty;