-
Notifications
You must be signed in to change notification settings - Fork 74
Closed
Description
I have some code in tilix that loops through parents looking for specific widget, at one point it hits the following line:
parent = cast(Container) parent.getParent();
This results in a segmentation fault when parent.getParent() returns null. Should opCast be smart enough to check for null and then just short circuit the method and return null?
Right now I can protect against it using a null check:
if (parent.getParent() !is null)
parent = cast(Container) parent.getParent();
else
parent = null;
I think the change in opCast was introduced in January, I'm not sure the feature this is tied too is used overly much hence why it may have escaped detection until now.
The original tilix issue is here: gnunn1/tilix#1373
Metadata
Metadata
Assignees
Labels
No labels