Jump to content




[1.7.10][CC1.75] No type checking in shell.setPath()


3 replies to this topic

#1 blunty666

  • Members
  • 79 posts

Posted 22 July 2016 - 02:28 PM

Using shell.setPath() you can set the shell path to any value, including nil. Then when returning to the command line and typing in any character, the shell crashes with the error "string expected, got nil".

Reproduction:
Pass any variable except a string into shell.setPath(), then return to the shell command line and type any character.

#2 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 22 July 2016 - 10:16 PM

View Postblunty666, on 22 July 2016 - 02:28 PM, said:

Using shell.setPath() you can set the shell path to any value, including nil. Then when returning to the command line and typing in any character, the shell crashes with the error "string expected, got nil".

Reproduction:
Pass any variable except a string into shell.setPath(), then return to the shell command line and type any character.

Not really a bug so much as something to keep in mind. It can be argued that shell.setPath shouldn't do type checking. If you are worried about this you can either monkey patch it or type check yourself when using it.

#3 blunty666

  • Members
  • 79 posts

Posted 23 July 2016 - 08:26 PM

I wouldn't have considered it much of a problem if it wasn't for the fact it causes the shell to error and the computer to shutdown with only a short error message in between. It could be confusing for novice users if this happens and they can't work out why. That being said, you would expect someone using this to know vaguely what they are doing :) but this is why I put this up here, to bring it to people's atttention so Dan or someone with the power can decide...

#4 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 23 July 2016 - 11:34 PM

If that's the intention, I think this topic would be better in suggestions. But that's just my opinion.

Edited by Incinirate, 23 July 2016 - 11:34 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users