mattjlewis / diozero

Java Device I/O library that is portable across Single Board Computers and microcontrollers. Tested with Raspberry Pi, Odroid C2, BeagleBone Black, Next Thing CHIP, Asus Tinker Board and Arduinos / Pico. Supports GPIO, I2C, SPI as well as Serial communication. Also known to work with Udoo Quad.
https://www.diozero.com
MIT License
261 stars 59 forks source link

Fix NullPointerException when VERSION is not defined in /etc/os-release #106

Closed bwaldvogel closed 1 year ago

bwaldvogel commented 1 year ago

This is my suggested fix for the potential NullPointerException in LocalSystemInfo: https://github.com/mattjlewis/diozero/blob/5c0b697693ac3c5ef0e0118c5896d68d67035a59/diozero-core/src/main/java/com/diozero/sbc/LocalSystemInfo.java#L268

Please let me know what you think about this improvement and whether StringUtil is the right place to put the unquote method to.