Skip to content

Commit c6e7a43

Browse files
committed
Fix #163: NRE in ExternalCameraSelector when the camera transform is missing
1 parent 2c61214 commit c6e7a43

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Please always post your [KSP.log file](https://gist.github.com/JonnyOThan/04c207
99
- Fix fallback evaluators for lift, drag, and terminal velocity when FAR is not installed (thanks @KlyithSA)
1010
- Add RPMComputer modules to a few B9 Aerospace parts that were missing them
1111
- Disabled some propbatching when MAS is installed because it interferes with their patches
12+
- Fix NRE in ExternalCameraSelector when the camera transform is missing
1213

1314
## 1.0.2 - 2024-09-24
1415

RasterPropMonitor/Auxiliary modules/JSIExternalCameraSelector.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ public override void OnStart(PartModule.StartState state)
117117

118118
// Create the camera transform
119119
Transform containingTransform = part.FindModelTransform(cameraContainer);
120+
121+
if (containingTransform == null)
122+
{
123+
JUtil.LogErrorMessage(this, "No transform named {0} on part {1}", cameraContainer, part.partInfo.name);
124+
return;
125+
}
126+
120127
if (containingTransform.childCount > 0)
121128
{
122129
actualCamera = containingTransform.GetChild(0);

0 commit comments

Comments
 (0)