Skip to content

Commit 6ed2827

Browse files
committed
Fix #35: NRE spam when a RSE_RCS module was added to something that doesn't have RCS
1 parent 9843838 commit 6ed2827

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Source/RocketSoundEnhancement/PartModules/RSE_RCS.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Linq;
1+
using KSPBuildTools;
2+
using System.Linq;
23
using UnityEngine;
34

45
namespace RocketSoundEnhancement.PartModules
@@ -21,6 +22,11 @@ public override void OnStart(StartState state)
2122
base.OnStart(state);
2223

2324
moduleRCSFX = part.Modules.GetModule<ModuleRCSFX>();
25+
if (moduleRCSFX == null)
26+
{
27+
Log.Error("No ModuleRCSFX found on part " + part.partInfo.name);
28+
return;
29+
}
2430
Initialized = true;
2531
}
2632

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Improved scene switch performance (thanks @Phantomical )
66
- Fixed NRE spam when audio sources are destroyed in certain ways
7+
- Fixed NRE spam when a RSE_RCS module was added to a part that doesn't have RCS
78

89

910
## [0.9.11] - 03-25-24

0 commit comments

Comments
 (0)