You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2015/01/13 21:46:35 UTC
[jira] [Created] (HDFS-7606) Missing null check in
INodeFile#getBlocks()
Ted Yu created HDFS-7606:
----------------------------
Summary: Missing null check in INodeFile#getBlocks()
Key: HDFS-7606
URL: https://issues.apache.org/jira/browse/HDFS-7606
Project: Hadoop HDFS
Issue Type: Bug
Reporter: Ted Yu
Priority: Minor
{code}
BlockInfo[] snapshotBlocks = diff == null ? getBlocks() : diff.getBlocks();
if(snapshotBlocks != null)
return snapshotBlocks;
// Blocks are not in the current snapshot
// Find next snapshot with blocks present or return current file blocks
snapshotBlocks = getDiffs().findLaterSnapshotBlocks(diff.getSnapshotId());
{code}
If diff is null and snapshotBlocks is null, NullPointerException would result from the call to diff.getSnapshotId().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)