Fixed Emoji crash where LANG envvar is not defined in particularly exotic setups (msys bash in Powershell for example)

This commit is contained in:
Clinton Alexander 2016-06-09 14:12:27 +01:00 committed by Andras Slemmer
parent ecdd0a23a2
commit bef4258430

View File

@ -4,7 +4,7 @@ package com.r3corda.core.utilities
* A simple wrapper class that contains icons and support for printing them only when we're connected to a terminal.
*/
object Emoji {
val hasEmojiTerminal by lazy { System.getenv("TERM") != null && System.getenv("LANG").contains("UTF-8") }
val hasEmojiTerminal by lazy { System.getenv("TERM") != null && (System.getenv("LANG") != null) && System.getenv("LANG").contains("UTF-8") }
const val CODE_DIAMOND = "\ud83d\udd37"
const val CODE_BAG_OF_CASH = "\ud83d\udcb0"