You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @dkavolis,
Some BDArmory users have been occasionally having issues where, after running KSP for a while, planes suddenly have no lift (the aerodynamic forces overlay shows nothing) and can't take off. I found a bunch of the following in their log:
[LOG 17:54:47.562] [FAR v0.16.0.5]: Updating vessel voxel for GreyHawk II MkXa
[EXC 17:54:47.563] NullReferenceException: Object reference not set to an instance of an object
ferram4.FARControllableSurface.get_MovableSection () (at <1db2823b77704510ad0dd61fc9d23a0a>:0)
ferram4.FARControllableSurface.FixedUpdate () (at <1db2823b77704510ad0dd61fc9d23a0a>:0)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
This appears to be caused by part.FindModelTransform(transformName); returning null for some part (I suspect an EVA kerbal or the parachute in their inventory, the particular plane above uses an EVA kerbal in a command seat instead of a cockpit).
Adding in a null check fixes the issue, but means that part.FindModelTransform(transformName); is being called every fixedUpdate, so you may want to add a flag so that the check is only performed once and maybe give a warning in the log about the missing transform (in case the part is just badly configured and is fixable).
diff --git a/FerramAerospaceResearch/LEGACYferram4/FARControllableSurface.cs b/FerramAerospaceResearch/LEGACYferram4/FARControllableSurface.cs
index 426316c8..da6786bd 100644
--- a/FerramAerospaceResearch/LEGACYferram4/FARControllableSurface.cs+++ b/FerramAerospaceResearch/LEGACYferram4/FARControllableSurface.cs@@ -264,6 +264,7 @@ namespace ferram4
if (movableSection != null)
return movableSection;
movableSection = part.FindModelTransform(transformName); //And the transform
+ if (movableSection is null) return null;
if (!MovableOrigReady)
{
// In parts copied by symmetry, these fields should already be set,
The text was updated successfully, but these errors were encountered:
Thanks. Animations will now be disabled for parts without valid control surface models, no repeated calls to part.FindModelTransform but animations will not be reenabled if a valid transform is added which should be never/very rarely.
Hey @dkavolis,
Some BDArmory users have been occasionally having issues where, after running KSP for a while, planes suddenly have no lift (the aerodynamic forces overlay shows nothing) and can't take off. I found a bunch of the following in their log:
This appears to be caused by
part.FindModelTransform(transformName);
returningnull
for some part (I suspect an EVA kerbal or the parachute in their inventory, the particular plane above uses an EVA kerbal in a command seat instead of a cockpit).Adding in a
null
check fixes the issue, but means thatpart.FindModelTransform(transformName);
is being called everyfixedUpdate
, so you may want to add a flag so that the check is only performed once and maybe give a warning in the log about the missing transform (in case the part is just badly configured and is fixable).The text was updated successfully, but these errors were encountered: