DatBear / Guardians-of-the-Rift-Helper

Shows info about the Guardians of the Rift minigame
BSD 2-Clause "Simplified" License
7 stars 26 forks source link

fix(overlay): Canvas returned null for text location causing a null #59

Open robin239 opened 1 month ago

robin239 commented 1 month ago

issue:

Runelite was crashing very often while playing Guardians of the rift. The client, of my other account, wasn't having crashes.

After looking in the Runelite crash logs (in ~/.runelite/logs) I saw that it was crashing in renderActiveGuardians. As it is a production build it didn't state the line number.

So I cloned the plugin and lazily added a try/catch in the method. After a few seconds the debugger hit, giving me a null reference exception on line 128.

Solution: This is strange as Runelite adds a try/catch around the rendering of the overlay. However, Java is not my primary programming language. After adding a null check I haven't had any crash ever since. I've been doing quite a few Guardian of the rift games without any issues.

Speculation: This may have something to do with this specific exception not being catched? Maybe because of Linux or Arch linux? Something else?

As this is a null reference it was an issue anyway.

DatBear commented 1 month ago

Oh dang, I'll get this in on Monday, I'm camping right now, thanks for the fix!

On Fri, Jul 12, 2024, 5:10 AM robin239 @.***> wrote:

issue:

Runelite was crashing very often while playing Guardians of the rift. The client, of my other account, wasn't having crashes.

After looking in the Runelite crash logs (in ~/.runelite/logs) I saw that it was crashing in renderActiveGuardians. As it is a production build it didn't state the line number.

So I cloned the plugin and lazily added a try/catch in the method. After a few seconds the debugger hit, giving me a null reference exception on line 128.

Solution: This is strange as Runelite adds a try/catch around the rendering of the overlay. However, Java is not my primary programming language. After adding a null check I haven't had any crash ever since. I've been doing quite a few Guardian of the rift games without any issues.

Speculation: This may have something to do with this specific exception not being catched? Maybe because of Linux or Arch linux? Something else?

As this is a null reference it was an issue anyway.

You can view, comment on, or merge this pull request online at:

https://github.com/DatBear/Guardians-of-the-Rift-Helper/pull/59 Commit Summary

File Changes

(1 file https://github.com/DatBear/Guardians-of-the-Rift-Helper/pull/59/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/DatBear/Guardians-of-the-Rift-Helper/pull/59, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACRS35S6UWXSNNFEMDADIU3ZL6TQPAVCNFSM6AAAAABKYUGC76VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYDKMRSGQ2TMOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

robin239 commented 1 month ago

How was your camping trip? Any change you can review this PR?

robin239 commented 1 month ago

@DatBear Can you review this PR?