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
* Get the requested x size for this element. This is opposed to the actual size given in the {@link GuiImmediateContext context}. Giving this element less space than this may result in misaligned or overlapping rendering.
49
47
*/
@@ -58,14 +56,15 @@ public void setContext(GuiContext context) {
58
56
* Call this method to request focus in the current gui context.
59
57
*/
60
58
publicvoidrequestFocus() {
61
-
context.setFocusedElement(this);
59
+
if (context != null)
60
+
context.setFocusedElement(this);
62
61
}
63
62
64
63
/**
65
64
* Unfocus this element only if this element is selected.
66
65
*/
67
66
publicvoidblur() {
68
-
if (context.getFocusedElement() == this)
67
+
if (context != null && context.getFocusedElement() == this)
69
68
context.setFocusedElement(null);
70
69
}
71
70
@@ -86,7 +85,7 @@ public void setFocus(boolean shouldFocus) {
86
85
* @return true if this is focused directly, and has no focused child
0 commit comments