CyclopsMC/IntegratedScripting

Not selecting a valid member name results in hard crashing the server

Closed this issue ยท 4 comments

Issue type:

  • ๐Ÿ› Bug

I've been messing around trying to get Integrated Scripting to work, and ended up putting together a developer environment to peek into the source code under the hood to understand why it was crashing/where I was going wrong. I did not read the book carefully enough and noticed that you had to physically highlight the member names you want to bind to the cards, and instead was just clicking on the left, meaning the card was only storing "function" or "var", etc. Inadvertently found a bug by doing this, whenever you are validating the errors to display on the card inside of the block you imported it in, this will throw an error and hard crash due to a value being null and trying to access it further. I believe this only occurs on the 1.0.2, it seems like it was a PR to fix another bug that was happening.

This is the affected code that causes the crash

It may be worth investigating whether or not you can add the list of reserved keywords for javascript to invalid member names. I think I saw it's being done by RegEx only right now, unsure of how hard it would be to adapt further.


Short description:

Hard crash when not selecting a valid member name in the terminal, and then trying to use the card

Steps to reproduce the problem:

  1. Create a simple function inside of a card and instead of selecting the member test, just click on the left so that it selects function instead of test function test() { return true }
  2. Insert card into an operator slot
  3. Hard crash when trying to display the error that "function" is not a member inside of script.js

Expected behaviour:

The server should not crash and should be able to display the error properly


Versions:

  • This mod: 1.20.1-1.0.2
  • Minecraft: 1.20.1
  • Forge: 47.0.1

Log file:

Thanks for reporting!

Could you also share the actual crashlog?

My mistake, I meant to attach it with the original post and forgot, here you go

https://pastebin.com/M8HwizT1

Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

Super, thanks!