[misc] Fixed possible NPE