[xwiki/xwiki-platform] 17f59f: [Misc] Fix remaining SonarQube-reported NPE risks ...
Branch: refs/heads/stable-18.6.x Home: https://github.com/xwiki/xwiki-platform Commit: 17f59fc8c8697bf5ee71e46855f2ab51ea8f39a3 https://github.com/xwiki/xwiki-platform/commit/17f59fc8c8697bf5ee71e46855f2a... Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> 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) Co-authored-by: Vincent Massol <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications