Fix nullpointer while checking block type.