diff --git a/inc/certs.inc b/inc/certs.inc index 276799be..9686b22c 100755 --- a/inc/certs.inc +++ b/inc/certs.inc @@ -300,7 +300,7 @@ LISTCERTS(){ [ "${SEARCH}" != "0" ] && LISTCERTS -edit -search ${SEARCH} || LISTCERTS -edit exit 0 - elif [ "${CERTLIST[${certid}]}" != "" ]; then + elif [ "${certid}" != "" ] && [ "${CERTLIST[${certid}]}" != "" ]; then cert=${CERTLIST[${certid}]} certdir=${NM_CERTPATH}/live/${cert} SUBJECT=$(${NCMD} openssl x509 -in ${certdir}/cert.pem -noout -subject|grep -oP '(?<=CN = )[^,]+'|sort -uV)