modify anyMissing[dict] logic: having some null is ok, but all null is

not.
This commit is contained in:
Eric House 2014-09-30 21:26:34 -07:00
parent 8cc6f8b7cd
commit 44e0f30520

View file

@ -91,17 +91,17 @@ public class DictUtils {
public boolean anyMissing( final String[] names ) public boolean anyMissing( final String[] names )
{ {
boolean missing = false; boolean missing = false;
for ( int ii = 0; ii < m_paths.length; ++ii ) { int nNulls = 0;
if ( names[ii] != null ) { for ( int ii = 0; !missing && ii < m_paths.length; ++ii ) {
if ( names[ii] == null ) {
++nNulls;
} else {
// It's ok for there to be no dict IFF there's no // It's ok for there to be no dict IFF there's no
// name. That's a player using the default dict. // name. That's a player using the default dict.
if ( null == m_paths[ii] && null == m_bytes[ii] ) { missing = null == m_paths[ii] && null == m_bytes[ii];
missing = true;
break;
} }
} }
} return missing || nNulls == m_paths.length;
return missing;
} }
} // DictPairs } // DictPairs