Skip to content

Fix JS error when share button is missing on project list (#6154)#6155

Merged
dmetzner merged 1 commit intoCatrobat:developfrom
Aaditya0411:fix-ui-js-6154
Feb 10, 2026
Merged

Fix JS error when share button is missing on project list (#6154)#6155
dmetzner merged 1 commit intoCatrobat:developfrom
Aaditya0411:fix-ui-js-6154

Conversation

@Aaditya0411
Copy link
Copy Markdown
Contributor

Description

This PR adds a null-check before attaching the click handler to the project share button.

In some cases, the share button element is not present in the DOM, which caused a JavaScript error when navigator.share was available.

Changes

  • Added a safe null-check before calling addEventListener on the share button
  • Prevents runtime JS errors on the project list page

Related Issue

Fixes #6154

@Aaditya0411 Aaditya0411 requested a review from dmetzner as a code owner February 1, 2026 06:52
@Aaditya0411
Copy link
Copy Markdown
Contributor Author

Hi maintainers 👋
This is my first contribution to Catroweb.
Please let me know if any changes or improvements are required.
Thanks for reviewing!

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.94%. Comparing base (8a585eb) to head (9cfe3db).
⚠️ Report is 30 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #6155      +/-   ##
=============================================
- Coverage      51.94%   51.94%   -0.01%     
  Complexity      7964     7964              
=============================================
  Files            733      733              
  Lines          25569    25569              
=============================================
- Hits           13282    13281       -1     
- Misses         12287    12288       +1     
Flag Coverage Δ
behat 49.70% <ø> (-0.01%) ⬇️
phpunit 10.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dmetzner dmetzner merged commit ae0a34a into Catrobat:develop Feb 10, 2026
47 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.

Minor JavaScript UI improvement on project page

2 participants