Skip to content

Commit

Permalink
Fix potential NPE in BaseFileCopier
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jun 10, 2011
1 parent 65ca621 commit c40f68f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static File writeScriptTempFile(final ExecutionContext context, final Fil
*/
public static String appendRemoteFileExtensionForNode(final INodeEntry node, final String filepath) {
String result = filepath;
if ("windows".equalsIgnoreCase(node.getOsFamily().trim())) {
if (null != node.getOsFamily() && "windows".equalsIgnoreCase(node.getOsFamily().trim())) {
result += (filepath.endsWith(".bat") ? "" : ".bat");
} else {
result += (filepath.endsWith(".sh") ? "" : ".sh");
Expand All @@ -126,7 +126,7 @@ public static String getRemoteDirForNode(final INodeEntry node) {
return node.getAttributes().get(FILE_COPY_DESTINATION_DIR);
}
String remotedir = "/tmp/";
if ("windows".equalsIgnoreCase(node.getOsFamily().trim())) {
if (null != node.getOsFamily() && "windows".equalsIgnoreCase(node.getOsFamily().trim())) {
remotedir = "C:/WINDOWS/TEMP/";
}
return remotedir;
Expand Down

0 comments on commit c40f68f

Please sign in to comment.