Skip to content

Commit fd14b83

Browse files
committed
Fix #101: failing to find a transform for JSILabel is no longer fatal
1 parent 4ba533b commit fd14b83

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

RasterPropMonitor/Auxiliary modules/JSILabel.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,14 @@ public override void OnLoad(ConfigNode node)
168168
batchInfo.OnLoad(node);
169169

170170
Transform textObjTransform = JUtil.FindPropTransform(internalProp, transformName);
171+
172+
if (textObjTransform == null)
173+
{
174+
JUtil.LogErrorMessage(this, "Transform named {0} not found in prop {1}", transformName, internalProp.propName);
175+
return;
176+
}
177+
171178
Vector3 localScale = internalProp.transform.localScale;
172-
173179
Transform offsetTransform = new GameObject().transform;
174180
offsetTransform.gameObject.name = "JSILabel-" + this.internalProp.propID + "-" + this.GetHashCode().ToString();
175181
offsetTransform.gameObject.layer = textObjTransform.gameObject.layer;

0 commit comments

Comments
 (0)