Handle null inputs for subtracting CPThemes.

This commit is contained in:
Saikat Chakrabarti committed 2014-02-20 17:30:27 -08:00
1 parent 0450fdb542
commit 45a237af16
1 file changed
+4 -1
+4 -1
View File
@@ -420,7 +420,10 @@ function CPThemeState()
CPThemeState.subtractThemeStates = function(aState1, aState2)
{
if (aState2 === undefined || aState2 === nil || aState2._stateNames === undefined)
if (aState1 === undefined || aState1 === nil || aState1 === [CPNull null])
return CPThemeState._cacheThemeState(new ThemeState([]));
if (aState2 === undefined || aState2 === nil || aState2 === [CPNull null])
return aState1;
var statePointer1 = 0,