summaryrefslogtreecommitdiff
path: root/src/parameters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/parameters.cpp')
-rw-r--r--src/parameters.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parameters.cpp b/src/parameters.cpp
index 2fb2eef..b923bd5 100644
--- a/src/parameters.cpp
+++ b/src/parameters.cpp
@@ -39,6 +39,11 @@ Parameters::Parameters(zval *this_ptr, int argc TSRMLS_DC) : _this(this_ptr)
*/
Base *Parameters::object()
{
+ // do we have a this pointer in the first place? The member is not set
+ // when static methods are being called, or when a regular function is
+ // called in a static context
+ if (!_this) return nullptr;
+
// get the mixed object
MixedObject *obj = (MixedObject *)zend_object_store_get_object(_this TSRMLS_CC);