fix potential NPE in AbstractRootMethod.addAllocation()