Yes, except you should check the local variables, not the members :)

Also all the ifs can be rolled into one.