Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<manialink>
<quad id="quad" class="quad" />
<script><!--
main() {
declare CMlControl[] Array;
Page.GetClassChildren("quad", Page.MainFrame, True);
foreach (C in Page.GetClassChildren_Result) {
Array.add(C);
}
log(Array); // Logs: [(CGameManialinkControl*)#SOMEID]
Page.GetClassChildren("label", Page.MainFrame, True);
log(Array); // Logs: [(CGameManialinkControl*)#Null] and throws Runtime error
}
--></script>
</manialink>
Additionally accessing the element of the array (with log) throws the runtime error "Invalid access to parameter (Null object or elem not found in array) : Page.GetClassChildren_Result[0]". But I think the side effect of the GetClassChildren() is the real cause.