diff --git a/lib/ykpiv.c b/lib/ykpiv.c index 2c640a9..2e416ce 100644 --- a/lib/ykpiv.c +++ b/lib/ykpiv.c @@ -291,8 +291,8 @@ ykpiv_rc _ykpiv_select_application(ykpiv_state *state) { * can determine how to get the serial number, which for the NEO/Yk4 * will result in another selection of the PIV applet. */ - _ykpiv_get_version(state, NULL); - _ykpiv_get_serial(state, NULL, false); + res = _ykpiv_get_version(state, NULL); + if (res == YKPIV_OK) res = _ykpiv_get_serial(state, NULL, false); return res; }