Skip to content

Fix : NPE 해결 완료#118

Merged
c5ln merged 1 commit into
developfrom
fix/panel-npe-버그-수정
Aug 27, 2025

Hidden character warning

The head ref may contain hidden characters: "fix/panel-npe-\ubc84\uadf8-\uc218\uc815"
Merged

Fix : NPE 해결 완료#118
c5ln merged 1 commit into
developfrom
fix/panel-npe-버그-수정

Conversation

@c5ln
Copy link
Copy Markdown
Member

@c5ln c5ln commented Aug 27, 2025

Fix : NPE 해결 완료

Summary by CodeRabbit

  • Bug Fixes
    • 홈 화면 패널 데이터 조회 시 간헐적으로 발생하던 오류를 방지하여 안정성을 개선했습니다.
    • 오늘 생성된 일기 여부를 판단하는 과정에서 발생할 수 있는 예외 상황을 안전하게 처리했습니다.
    • 드물게 나타나던 빈 화면 표시나 오류 응답 가능성을 낮췄습니다.
    • 동작 방식이나 사용자 경험의 변화 없이 신뢰성을 향상했습니다.

@c5ln c5ln self-assigned this Aug 27, 2025
@c5ln c5ln linked an issue Aug 27, 2025 that may be closed by this pull request
3 tasks
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

HomeService.getPannelData에 일기 객체 접근 전 null 체크를 추가하여 diary가 null인 경우 getCreatedAt() 호출로 인한 NullPointerException을 방지했습니다. 그 외 로직과 공개 API 시그니처 변경은 없습니다.

Changes

Cohort / File(s) Change Summary
Null-safety in Home panel logic
src/main/java/.../home/service/HomeService.java
getPannelData에서 diary null 체크를 추가하고 생성일 비교를 diary != null && diary.getCreatedAt().isAfter(LocalDate.now().atStartOfDay()) 형태로 안전하게 수행하도록 수정

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Controller
  participant S as HomeService
  participant R as DiaryRepository

  C->>S: getPannelData(userId)
  S->>R: findLatestDiary(userId)
  R-->>S: diary or null

  alt diary == null
    note over S: Null 체크로 NPE 방지
    S-->>C: 패널 데이터(일기 없음 케이스)
  else diary != null
    alt diary.createdAt isAfter startOfToday
      S-->>C: 패널 데이터(금일 일기 있음)
    else
      S-->>C: 패널 데이터(금일 일기 없음)
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

꼬박꼬박 코드밭을 누비는 토끼 🐇
빈 당근 바구니(null)도 살짝살짝 확인하지요
새벽의 시간과 오늘을 견줘보며
툭, 예외의 덫은 멀찍이 피하고
폴짝! 패널엔 고요한 안심만 남았네

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a259bbe and c9319e0.

📒 Files selected for processing (1)
  • src/main/java/com/example/cp_main_be/domain/home/service/HomeService.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/panel-npe-버그-수정

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

🚨 PR 본문이 비어있습니다!

아래 템플릿을 복사하여 PR 내용을 작성해주세요.


📝 개요

이번 PR의 핵심 내용을 한 줄로 요약해 주세요.


💻 작업 내용

이번 PR에서 작업한 내용을 상세히 설명해 주세요.

  • 작업 내용 1
  • 작업 내용 2
  • ...

✅ PR 체크리스트

PR을 보내기 전에 아래 체크리스트를 확인해 주세요.

  • 커밋 메시지는 포맷에 맞게 작성했나요?
  • 스스로 코드를 다시 한번 검토했나요?
  • 관련 이슈를 연결했나요?
  • 빌드 및 테스트가 로컬에서 성공했나요?

🔗 관련 이슈

이번 PR과 관련된 이슈 번호를 기재해 주세요.
예: Closes #123


스크린샷 (선택)

UI 변경 사항이 있다면 스크린샷을 첨부해 주세요.

@c5ln c5ln merged commit 6086c8f into develop Aug 27, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix : panel NPE 버그 수정 , Diary에 예외처리

1 participant