Merge pull request #115 from c0nnex/CrashFix

Fix crash on line without spaces
This commit is contained in:
Mitch Roote 2018-08-04 07:24:05 -04:00 committed by GitHub
commit 7e97976f8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,7 +208,7 @@ func (f *FactorioServer) parseRunningCommand(std io.ReadCloser) (err error) {
line := strings.Fields(stdScanner.Text())
// Ensure logline slice is in bounds
if len(line) > 0 {
if len(line) > 1 {
// Check if Factorio Server reports any errors if so handle it
if line[1] == "Error" {
err := f.checkLogError(line)