Fixed possible bug, null-check greeting first