TRACKR-221 - Use ?. operator in principal id checks for security