diff --git a/ci/pypi.sh b/ci/pypi.sh
index 471937e3b154e416c91dc1970323448c5ea5d0e2..1695f9a14c8646f19213ed9404b4d92779edc130 100755
--- a/ci/pypi.sh
+++ b/ci/pypi.sh
@@ -56,10 +56,12 @@ green_echo "[>>] Uploading first to ${TESTSERVER} on behalf of ${PYPIUSER}..."
 setup check sdist --formats zip upload --repository staging
 green_echo "[<<] Test finished, proceeding..."
 
-# if that worked, uploads documentation to pythonhosted
-green_echo "[>>] Uploading documentation on behalf of ${PYPIUSER}..."
-setup upload_docs --upload-dir sphinx
-green_echo "[<<] Documentation uploaded, proceeding..."
+# if that worked, uploads documentation to pythonhosted if any exists
+if [ -d doc ]; then
+  green_echo "[>>] Uploading documentation on behalf of ${PYPIUSER}..."
+  setup upload_docs --upload-dir sphinx
+  green_echo "[<<] Documentation uploaded, proceeding..."
+fi
 
 # if that worked, uploads source package to the production index
 green_echo "[>>] Uploading package to ${PYPISERVER} on behalf of ${PYPIUSER}..."