chore: check for npe when fetching the lastDeployedAt (#40907)
## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.All" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > 🟣 🟣 🟣 Your tests are running. > Tests running at: <https://github.com/appsmithorg/appsmith/actions/runs/15552147609> > Commit: 5866f171b4cd5030ffef11d7c8cbed92d649d8c0 > Workflow: `PR Automation test suite` > Tags: `@tag.All` > Spec: `` > <hr>Tue, 10 Jun 2025 06:24:21 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
This commit is contained in:
parent
b6fc1de100
commit
a88ec80bb1
|
|
@ -62,6 +62,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -660,14 +661,12 @@ public class ConsolidatedAPIServiceCEImpl implements ConsolidatedAPIServiceCE {
|
|||
Span computeEtagSpan = observationHelper.createSpan(ETAG_SPAN).start();
|
||||
|
||||
try {
|
||||
String lastDeployedAt = consolidatedAPIResponseDTO.getPages() != null
|
||||
? consolidatedAPIResponseDTO
|
||||
.getPages()
|
||||
.getData()
|
||||
.getApplication()
|
||||
.getLastDeployedAt()
|
||||
.toString()
|
||||
: null;
|
||||
String lastDeployedAt = Optional.ofNullable(consolidatedAPIResponseDTO.getPages())
|
||||
.map(pages -> pages.getData())
|
||||
.map(data -> data.getApplication())
|
||||
.map(application -> application.getLastDeployedAt())
|
||||
.map(lastDeployed -> lastDeployed.toString())
|
||||
.orElse(null);
|
||||
|
||||
if (lastDeployedAt == null) {
|
||||
log.debug(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user