add missing null check in librarydestroy introduced by object base unification