Null check before set