mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 21:35:21 +00:00
fix readline crash when user presses ctrl+D
This commit is contained in:
parent
b06ca6eb0b
commit
31f0437c96
@ -103,8 +103,7 @@ class CommandReader extends Thread{
|
|||||||
private function readLine() : bool{
|
private function readLine() : bool{
|
||||||
$line = "";
|
$line = "";
|
||||||
if($this->type === self::TYPE_READLINE){
|
if($this->type === self::TYPE_READLINE){
|
||||||
$line = trim(readline("> "));
|
if(($raw = readline("> ")) !== false and ($line = trim($raw)) !== ""){
|
||||||
if($line !== ""){
|
|
||||||
readline_add_history($line);
|
readline_add_history($line);
|
||||||
}else{
|
}else{
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user