You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Guard 'content' against null in LoginLayout.onAttach #29
In LoginLayout.onAttach, the content field is dereferenced at multiple points (appending to the element, setting the slot attribute, and executing JS) without a null check. If the layout attaches before routed content is available, this could throw a NullPointerException and potentially leave the overlay in a partially modified state.
Suggested fix
Add an early-return guard before the form replacement logic:
@OverrideprotectedvoidonAttach(AttachEventattachEvent) {
super.onAttach(attachEvent);
setOpened(true);
if (content == null) {
return;
}
// ... rest of the method
}
Context
This issue was identified during code review of PR #28 (comment: #28 (comment)). The concern originates from the original implementation and was not introduced by PR #28.
Closing as not planned. The RouterLayout lifecycle guarantees that showRouterLayoutContent is called before the component is attached, so content is never null when onAttach fires. The scenario described by the bot is structurally impossible.
Activity
javier-godoy commentedon Apr 20, 2026
Closing as not planned. The
RouterLayoutlifecycle guarantees thatshowRouterLayoutContentis called before the component is attached, socontentis never null whenonAttachfires. The scenario described by the bot is structurally impossible.