biud436 / MV

🏰 This plugin package includes helpful features to get you on your way to create your game in RPG Maker MV.
MIT License
64 stars 51 forks source link

fix: error causes if you press button OK when there’s no text input in RS_InputDialog.js #35

Closed biud436 closed 12 months ago

biud436 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

see below link : https://twitter.com/Fujitsuki15/status/1691441151247892480

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Code

https://github.com/biud436/MV/blob/36d1713a81a4cfa2e1c296e972715ec8f2f46cce/RS_InputDialog.js#L1093-L1104 https://github.com/biud436/MV/blob/36d1713a81a4cfa2e1c296e972715ec8f2f46cce/RS_InputDialog.js#L1202-L1223


biud436 commented 1 year ago

This appears to be an error unrelated to this plugin, but if it's null or undefined, I think we should assign a default value to make it safer.

const text = $gameVariables.value(YOUR_ID);
if(text && typeof(text) === "string") {
    // handle the code block called `text.LowerCase()`
}