Avoid NPE when generating scrub error message

Patch by Stefania Alborghetti; reviewed by Tyler Hobbs for
CASSANDRA-9290
This commit is contained in:
Stefania Alborghetti 2015-05-05 11:18:23 -05:00 committed by Tyler Hobbs
parent a11bc78656
commit dbb36a476b
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ public class Scrubber implements Closeable
if (key == null)
throw new IOError(new IOException("Unable to read row key from data file"));
if (!key.key.equals(currentIndexKey))
if (currentIndexKey != null && !key.key.equals(currentIndexKey))
{
throw new IOError(new IOException(String.format("Key from data file (%s) does not match key from index file (%s)",
ByteBufferUtil.bytesToHex(key.key), ByteBufferUtil.bytesToHex(currentIndexKey))));