Fix error on "(at) anchor" selector when no anchor is opened.

This commit is contained in:
2023-01-16 20:57:19 +08:00
parent 86559c681e
commit 29432feabc

View File

@@ -89,7 +89,7 @@ namespace Cryville.Crtr {
else return Enumerable.Empty<SkinContext>();
}
public override bool IsUpdatable(ContainerState h) {
return h.Handler.OpenedAnchor.Name == Name;
return h.Handler.OpenedAnchor != null && h.Handler.OpenedAnchor.Name == Name;
}
}
public class AtAnchor : SkinSelector {
@@ -101,7 +101,7 @@ namespace Cryville.Crtr {
return IsUpdatable(h) ? c : null;
}
public override bool IsUpdatable(ContainerState h) {
return h.Handler.OpenedAnchor.Name == Name;
return h.Handler.OpenedAnchor != null && h.Handler.OpenedAnchor.Name == Name;
}
}
public class Property : SkinSelector {