Skip to content

Commit 12c30e4

Browse files
committed
also raise exception in EnchantBroker::requestDict/requestPWL
1 parent b9473aa commit 12c30e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/enchant/enchant.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ PHP_FUNCTION(enchant_broker_request_dict)
506506
dict = Z_ENCHANT_DICT_P(return_value);
507507
dict->pdict =pdict;
508508
ZVAL_COPY(&dict->zbroker, broker);
509+
} else if (getThis()) {
510+
zend_throw_exception(spl_ce_RuntimeException, "Can't create a new EnchantDict", 0);
509511
} else {
510512
RETURN_FALSE;
511513
}
@@ -584,6 +586,8 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
584586
dict = Z_ENCHANT_DICT_P(return_value);
585587
dict->pdict = pdict;
586588
ZVAL_COPY(&dict->zbroker, broker);
589+
} else if (getThis()) {
590+
zend_throw_exception(spl_ce_RuntimeException, "Can't create a new EnchantDict", 0);
587591
} else {
588592
RETURN_FALSE;
589593
}

0 commit comments

Comments
 (0)