frameworks: fix NullPointerException