I’m guessing that address2 is not required, is that right? If so, then you have an ‘and’ operator where you should have an ‘or’ operator:
( ! empty( $address1 ) && ! empty( $address2 ) )
should be
( ! empty( $address1 ) || ! empty( $address2 ) )