[xwiki/xwiki-platform] 84d22a: [Misc] Fix remaining SonarQube-reported NPE risks ...
Branch: refs/heads/backport/stable-18.6.x/pr-5941 Home: https://github.com/xwiki/xwiki-platform Commit: 84d22a7555949051ab71c4a8de3fd835d7ced370 https://github.com/xwiki/xwiki-platform/commit/84d22a7555949051ab71c4a8de3fd... Author: Vincent Massol <[email protected]> Date: 2026-07-24 (Fri, 24 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). (cherry picked from commit de737018e980d44e177dcf801c5e13d2239a2ba5) To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications