[Fix] Fixed NPE in toString()

This commit is contained in:
Robert von Burg 2024-02-06 15:22:43 +01:00
parent 69d1f77364
commit c66446391a
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
3 changed files with 5 additions and 1 deletions

View File

@ -330,6 +330,8 @@ public class Order extends AbstractStrolchRootElement implements StrolchRootElem
@Override
public String toString() {
if (this.version == null)
return getLocator().toString();
return getLocator() + ", Version: " + this.version.getVersion();
}

View File

@ -401,6 +401,8 @@ public class Resource extends AbstractStrolchRootElement implements StrolchRootE
@Override
public String toString() {
if (this.version == null)
return getLocator().toString();
return getLocator() + ", Version: " + this.version.getVersion();
}

View File

@ -786,7 +786,7 @@ public class Activity extends AbstractStrolchRootElement
builder.append(getStart());
builder.append(", end=");
builder.append(getEnd());
if (isRootElement()) {
if (isRootElement() && this.version != null) {
builder.append(", version=");
builder.append(this.version.getVersion());
}