[geos-commits] [SCM] GEOS branch main updated. 23ae165cf1e6a6fc0f98a1360f986fafa0932923

git at osgeo.org git at osgeo.org
Fri Apr 28 11:19:07 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  23ae165cf1e6a6fc0f98a1360f986fafa0932923 (commit)
      from  4e3fbef9f32588e54157568b07bb840a94a415eb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 23ae165cf1e6a6fc0f98a1360f986fafa0932923
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Apr 28 11:05:22 2023 -0700

    Throw exception on non-initialization rather than quiet failure, GH-873 (#880)

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index e166e112a..7c9333d1d 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -390,7 +390,7 @@ inline auto execute(
                                   decltype(std::declval<F>()())>::type errval,
         F&& f) -> decltype(errval) {
     if (extHandle == nullptr) {
-        return errval;
+        throw std::runtime_error("GEOS context handle is unintialized, call initGEOS");
     }
 
     GEOSContextHandleInternal_t* handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
@@ -414,7 +414,7 @@ inline auto execute(
 template<typename F, typename std::enable_if<!std::is_void<decltype(std::declval<F>()())>::value, std::nullptr_t>::type = nullptr>
 inline auto execute(GEOSContextHandle_t extHandle, F&& f) -> decltype(f()) {
     if (extHandle == nullptr) {
-        return nullptr;
+        throw std::runtime_error("context handle is unintialized, call initGEOS");
     }
 
     GEOSContextHandleInternal_t* handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);

-----------------------------------------------------------------------

Summary of changes:
 capi/geos_ts_c.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list