Commit 634b0659a3c19cd9b82a741282c9fb7e0a61e493

Authored by Mumfrey
1 parent 1219bac9

add null checks for window event handlers

java/client/com/mumfrey/liteloader/client/CallbackProxyClient.java
@@ -270,11 +270,13 @@ public class CallbackProxyClient @@ -270,11 +270,13 @@ public class CallbackProxyClient
270 270
271 public static void onResize(EventInfo<Minecraft> e) 271 public static void onResize(EventInfo<Minecraft> e)
272 { 272 {
  273 + if (CallbackProxyClient.events == null) return;
273 CallbackProxyClient.events.onResize(e.getSource()); 274 CallbackProxyClient.events.onResize(e.getSource());
274 } 275 }
275 276
276 public static void preRenderFBO(EventInfo<Minecraft> e) 277 public static void preRenderFBO(EventInfo<Minecraft> e)
277 { 278 {
  279 + if (CallbackProxyClient.events == null) return;
278 CallbackProxyClient.fboEnabled = OpenGlHelper.isFramebufferEnabled(); 280 CallbackProxyClient.fboEnabled = OpenGlHelper.isFramebufferEnabled();
279 281
280 if (CallbackProxyClient.fboEnabled) 282 if (CallbackProxyClient.fboEnabled)
@@ -286,6 +288,7 @@ public class CallbackProxyClient @@ -286,6 +288,7 @@ public class CallbackProxyClient
286 288
287 public static void postRenderFBO(EventInfo<Minecraft> e) 289 public static void postRenderFBO(EventInfo<Minecraft> e)
288 { 290 {
  291 + if (CallbackProxyClient.events == null) return;
289 CallbackProxyClient.renderingFBO = false; 292 CallbackProxyClient.renderingFBO = false;
290 293
291 if (CallbackProxyClient.fboEnabled) 294 if (CallbackProxyClient.fboEnabled)
@@ -296,6 +299,7 @@ public class CallbackProxyClient @@ -296,6 +299,7 @@ public class CallbackProxyClient
296 299
297 public static void renderFBO(EventInfo<Framebuffer> e, int width, int height) 300 public static void renderFBO(EventInfo<Framebuffer> e, int width, int height)
298 { 301 {
  302 + if (CallbackProxyClient.events == null) return;
299 if (CallbackProxyClient.renderingFBO) 303 if (CallbackProxyClient.renderingFBO)
300 { 304 {
301 CallbackProxyClient.events.onRenderFBO(e.getSource(), width, height); 305 CallbackProxyClient.events.onRenderFBO(e.getSource(), width, height);