From f1eb93c6477a7a65bfadb3ee7e3871af96e2c148 Mon Sep 17 00:00:00 2001 From: Azra Victor Date: Wed, 23 Jun 2021 20:05:39 +0200 Subject: [PATCH] changed nextframebuffer.clone() so it hopefully won't crash --- src/gameplay/frames/nextFrameBuffer.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/gameplay/frames/nextFrameBuffer.java b/src/gameplay/frames/nextFrameBuffer.java index 1bd2247..6d6cb3f 100644 --- a/src/gameplay/frames/nextFrameBuffer.java +++ b/src/gameplay/frames/nextFrameBuffer.java @@ -24,8 +24,21 @@ public class nextFrameBuffer { } public void clone(nextFrameBuffer f) { - this.current = f.current; - this.next = f.next; + + try{ + Frame cf = new Frame(); + cf.clone(f.current); + this.current = cf; } + catch (NullPointerException n) { + this.current = null; + this.next = null; + } + nextFrameBuffer nfb = new nextFrameBuffer(); + try { + nfb.clone(f.next); + } catch (NullPointerException n) {} + this.next = nfb; + } public void setNext(nextFrameBuffer f) {