Fix NPE when accessing services before OPA is ready.

This commit is contained in:
Shrikant Kandula 2020-04-22 08:41:40 +05:30
parent 1a19a9b698
commit a8842e962b
2 changed files with 5 additions and 3 deletions

View File

@ -1,12 +1,14 @@
package com.appsmith.server.acl;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
public class OpaResponse {
Boolean result;
public boolean isSuccessful() {
return Boolean.TRUE.equals(result);
}
}

View File

@ -71,7 +71,7 @@ public class AclFilter implements WebFilter {
return acl;
})
.flatMap(acl -> {
if (acl != null && acl.getResult()) {
if (acl != null && acl.isSuccessful()) {
// Acl returned true. Continue with the filter chain
return chain.filter(exchange);
}