Skip to content

Commit

Permalink
Merge pull request #202 from viest/dev
Browse files Browse the repository at this point in the history
Fix: sheet call back value is null
  • Loading branch information
viest authored Nov 21, 2019
2 parents 516d712 + 1892c05 commit 0270e80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kernel/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba

ZVAL_LONG(&args[0], (row - 1));
ZVAL_LONG(&args[1], (col - 1));
ZVAL_NULL(&args[2]);

if (value == NULL) {
goto CALL_USER_FUNCTION;
}

if (Z_TYPE_P(_callback_data->zv_type_t) != IS_ARRAY) {
zend_long _long = 0; double _double = 0;
Expand All @@ -314,10 +319,11 @@ int sheet_cell_callback (size_t row, size_t col, const char *value, void *callba
}
}

ZVAL_NULL(&args[2]);
data_to_custom_type(value, _type, &args[2]);
}

CALL_USER_FUNCTION:

zend_call_function(_callback_data->fci, _callback_data->fci_cache);

zval_ptr_dtor(&args[2]);
Expand Down

0 comments on commit 0270e80

Please sign in to comment.