--- a/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
+++ b/com/mojang/realmsclient/gui/screens/RealmsGenericErrorScreen.java
@@ -63,6 +63,15 @@
       }));
    }
 
+    @Override
+    public boolean func_231046_a_(int key, int scanCode, int modifiers) {
+        if (key == org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE) {
+            field_230706_i_.func_147108_a(this.field_224228_a);
+            return true;
+        }
+        return super.func_231046_a_(key, scanCode, modifiers);
+    }
+
    public void func_230430_a_(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_) {
       this.func_230446_a_(p_230430_1_);
       func_238472_a_(p_230430_1_, this.field_230712_o_, this.field_224229_b, this.field_230708_k_ / 2, 80, 16777215);
