[xwiki/xwiki-platform] 81a6f1: [Misc] Fix remaining SonarQube-reported NPE risks ...
Branch: refs/heads/misc-sonar-npe-xwikidocument Home: https://github.com/xwiki/xwiki-platform Commit: 81a6f1f16f4e121b6f81088d85887d25f850302d https://github.com/xwiki/xwiki-platform/commit/81a6f1f16f4e121b6f81088d85887... Author: Vincent Massol <[email protected]> Date: 2026-07-23 (Thu, 23 Jul 2026) Changed paths: M xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java Log Message: ----------- [Misc] Fix remaining SonarQube-reported NPE risks blocking the quality gate * copyAttachment: getXWikiContext() can return null, so reuse the captured context and guard the author reference lookup instead of dereferencing a possibly-null context a second time. * backupContext: require a non-null context up front, since all the data backed up below is read from it. * Annotate getXWikiContext() with @Nullable to document that it can return null (which is what makes the direct dereferences above unsafe). To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications