- ep->open = 1;
- #if NNG_UNDER_TEST
- state = uta_epsock_byname( rt, "localhost:4561", &nn_sock, NULL ); // test coverage on nil checks
- #else
- state = uta_epsock_byname( ctx, "localhost:4561", &nn_sock, NULL );
- #endif
- errors += fail_if_equal( state, 0, "socket (by name) open ep check returned false" );
+ if( ep ) { // if previous test fails, cant run this
+ ep->open = 1;
+ #if NNG_UNDER_TEST
+ state = uta_epsock_byname( rt, "localhost:4561", &nn_sock, NULL ); // test coverage on nil checks
+ #else
+ state = uta_epsock_byname( ctx, "localhost:4561", &nn_sock, NULL );
+ #endif
+ errors += fail_if_equal( state, 0, "socket (by name) open ep check returned false" );
+ }