Skip to content

Commit 65a2cb3

Browse files
committed
Check for input path to not be null
1 parent c39a476 commit 65a2cb3

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/com/inet/gradle/setup/unix/deb/DebBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ private void createDebianPackage() {
497497
* on I/O failures
498498
*/
499499
private void changeDirectoryPermissionsTo755( File path ) throws IOException {
500+
if ( path == null ) { return; }
500501
DebUtils.setPermissions( path, true );
501502
for( File file : path.listFiles() ) {
502503
if( file.isDirectory() ) {
@@ -514,6 +515,7 @@ private void changeDirectoryPermissionsTo755( File path ) throws IOException {
514515
* on I/O failures
515516
*/
516517
private void changeFilePermissionsTo644( File path ) throws IOException {
518+
if ( path == null ) { return; }
517519
for( File file : path.listFiles() ) {
518520
if( file.isDirectory() ) {
519521
changeFilePermissionsTo644( file );

src/com/inet/gradle/setup/unix/rpm/RpmBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ private void setupService( Service service ) throws IOException {
194194
*/
195195
// share
196196
private void changeDirectoryPermissionsTo755( File path ) throws IOException {
197+
if ( path == null ) { return; }
197198
setPermissions( path, true );
198199
for( File file : path.listFiles() ) {
199200
if( file.isDirectory() ) {
@@ -210,6 +211,7 @@ private void changeDirectoryPermissionsTo755( File path ) throws IOException {
210211
*/
211212
// share
212213
private void changeFilePermissionsTo644( File path ) throws IOException {
214+
if ( path == null ) { return; }
213215
for( File file : path.listFiles() ) {
214216
if( file.isDirectory() ) {
215217
changeFilePermissionsTo644( file );

0 commit comments

Comments
 (0)