1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-07 05:54:15 +01:00

Fix: Treat null the same as an empty string for type detection - i.e. don't try to detect a type on it. Regression picked up by unit tests

This commit is contained in:
Allan Jardine 2011-05-28 11:06:38 +01:00
parent 53908784fe
commit e769731746

View File

@ -725,7 +725,7 @@
{ {
return 'numeric'; return 'numeric';
} }
else if ( sData === null || typeof sData != 'string' ) else if ( typeof sData != 'string' )
{ {
return null; return null;
} }
@ -2691,7 +2691,7 @@
{ {
/* Attempt to auto detect the type - same as _fnGatherData() */ /* Attempt to auto detect the type - same as _fnGatherData() */
var sVarType = _fnGetCellData( oSettings, iRow, i, 'type' ); var sVarType = _fnGetCellData( oSettings, iRow, i, 'type' );
if ( sVarType !== '' ) if ( sVarType !== null && sVarType !== '' )
{ {
sThisType = _fnDetectType( sVarType ); sThisType = _fnDetectType( sVarType );
if ( oCol.sType === null ) if ( oCol.sType === null )