#vulnerable code 
                             private boolean resetDosPermissions(Path file, FileState fileState, DosFileAttributes dosFileAttributes)
	{
		String permissions = DosFilePermissions.toString(dosFileAttributes);
		String previousPermissions = getAttribute(fileState, FileAttribute.DosFilePermissions);
		if (!Objects.equals(permissions, previousPermissions))
		{
			DosFilePermissions.setPermissions(file, previousPermissions);
			System.out.printf("Set permissions: %s \t%s -> %s%n", fileState.getFileName(), permissions, previousPermissions);
			return true;
		}
		return false;
	} 
                            #location 7 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             private boolean resetDosPermissions(Path file, FileState fileState, DosFileAttributes dosFileAttributes)
	{
		String permissions = DosFilePermissions.toString(dosFileAttributes);
		String previousPermissions = getAttribute(fileState, FileAttribute.DosFilePermissions);
		if (previousPermissions != null && !Objects.equals(permissions, previousPermissions))
		{
			DosFilePermissions.setPermissions(file, previousPermissions);
			System.out.printf("Set permissions: %s \t%s -> %s%n", fileState.getFileName(), permissions, previousPermissions);
			return true;
		}
		return false;
	}