[xwiki/xwiki-platform] de7370: [Misc] Fix remaining SonarQube-reported NPE risks ...
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-platform Commit: de737018e980d44e177dcf801c5e13d2239a2ba5 https://github.com/xwiki/xwiki-platform/commit/de737018e980d44e177dcf801c5e1... 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). To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications
participants (1)
-
XWiki Notifications