I think this method would take null in that case.  I think this test is testing that empty string is a valid password.  Looks like your fix should handle both cases though!