tdf#122136: select first element if there's at least one

See bt from https://bugs.documentfoundation.org/attachment.cgi?id=147594

Change-Id: Ibf031b8024aa4952e2d3263a445cafdb3c031390
Reviewed-on: https://gerrit.libreoffice.org/65221
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 5f44c6d..69b1b82 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -1014,9 +1014,9 @@ void SvxJavaClassPathDlg::SetClassPath( const OUString& _rPath )
            m_xPathList->append("", sPath, SvFileInformationManager::GetImageId(aURL));
        }
        while (nIdx>=0);
        // select first entry
        m_xPathList->select(0);
    }
    // select first entry
    m_xPathList->select(0);
    SelectHdl_Impl(*m_xPathList);
}