File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ static bool php_phongo_writeconcern_init_from_hash(php_phongo_writeconcern_t* in
111
111
static PHP_METHOD (WriteConcern , __construct )
112
112
{
113
113
php_phongo_writeconcern_t * intern ;
114
- zval * w , * journal ;
114
+ zval * w , * journal = NULL ;
115
115
zend_long wtimeout = 0 ;
116
116
117
117
intern = Z_WRITECONCERN_OBJ_P (getThis ());
@@ -144,7 +144,7 @@ static PHP_METHOD(WriteConcern, __construct)
144
144
145
145
switch (ZEND_NUM_ARGS ()) {
146
146
case 3 :
147
- if (Z_TYPE_P (journal ) != IS_NULL ) {
147
+ if (journal && Z_TYPE_P (journal ) != IS_NULL ) {
148
148
if (zend_is_true (journal ) && (mongoc_write_concern_get_w (intern -> write_concern ) == MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED || mongoc_write_concern_get_w (intern -> write_concern ) == MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED )) {
149
149
phongo_throw_exception (PHONGO_ERROR_INVALID_ARGUMENT , "Cannot enable journaling when using w = 0" );
150
150
return ;
You can’t perform that action at this time.
0 commit comments