Skip to content

Commit

Permalink
pnfsmanager: fix NPE regression from 3dfed7e
Browse files Browse the repository at this point in the history
Motivation:

Commit 3dfed7e introduced a regression because it assumes that a
successful entry creation will have a non-null set of file attributes.

This is not true if a symbolic link is created, in which case there is
an NPE.

Modification:

Update code to check if value is non-null.

Result:

A regression is fixed the prevents creating a symbolic link.

Target: master
Request: 7.0
Request: 6.2
Request: 6.1
Requires-notes: yes
Requires-book: no
Patch: https://rb.dcache.org/r/12985/
Acked-by: Dmitry Litvintsev
Acked-by: Lea Morschel
Acked-by: Albert Rossi
  • Loading branch information
paulmillar authored and mksahakyan committed Apr 21, 2021
1 parent 09f09d9 commit 6559fcd
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,9 @@ private void postProcessMessage(CellMessage envelope, PnfsMessage message)
private void postProcessSetFileAttributes(PnfsSetFileAttributes message)
{
FileAttributes attributes = message.getFileAttributes();
if (attributes == null) {
return;
}
Optional<AccessLatency> al = attributes.getAccessLatencyIfPresent();
Optional<RetentionPolicy> rp = attributes.getRetentionPolicyIfPresent();
if (al.isPresent() || rp. isPresent()) {
Expand Down

0 comments on commit 6559fcd

Please sign in to comment.