Attempt to solve Bug #2795. review @dinhviethoa

review @dinhviethoa 
We usually format such early exits from functions as `if (entry == null) return null;`