mirror of https://github.com/apache/druid.git
Merge pull request #1703 from metamx/fix-npe
add null check for task context.
This commit is contained in:
commit
9b5889b393
|
@ -215,15 +215,18 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
|
|||
}
|
||||
|
||||
// Override task specific properties
|
||||
for (String propName : task.getContext().keySet()) {
|
||||
if (propName.startsWith(CHILD_PROPERTY_PREFIX)) {
|
||||
command.add(
|
||||
String.format(
|
||||
"-D%s=%s",
|
||||
propName.substring(CHILD_PROPERTY_PREFIX.length()),
|
||||
task.getContextValue(propName)
|
||||
)
|
||||
);
|
||||
final Map<String, Object> context = task.getContext();
|
||||
if (context != null) {
|
||||
for (String propName : context.keySet()) {
|
||||
if (propName.startsWith(CHILD_PROPERTY_PREFIX)) {
|
||||
command.add(
|
||||
String.format(
|
||||
"-D%s=%s",
|
||||
propName.substring(CHILD_PROPERTY_PREFIX.length()),
|
||||
task.getContextValue(propName)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue