Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tik4net/Api/ApiCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ private IEnumerable<ITikReSentence> ExecuteListInternal(params string[] proplist
EnsureReReponse(response.Take(response.Count() - 1).ToArray()); //!re - reapeating
EnsureDoneResponse(response.Last()); //!done

if (response.First() is ApiEmptySentence)
return new List<ITikReSentence>();
return response.Take(response.Count() - 1).Cast<ITikReSentence>().ToList();
}
finally
Expand Down
1 change: 1 addition & 0 deletions tik4net/Api/ApiConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ private ITikSentence ReadSentence()
case "!trap": return new ApiTrapSentence(sentenceWords);
case "!re": return new ApiReSentence(sentenceWords);
case "!fatal": return new ApiFatalSentence(sentenceWords);
case "!empty": return new ApiEmptySentence();
case "": throw new IOException("Can not read sentence from connection"); // With SSL possibly not logged in (SSL and new router with SSL_V2)
default: throw new NotImplementedException(string.Format("Response type '{0}' not supported", sentenceName));
}
Expand Down
25 changes: 25 additions & 0 deletions tik4net/Api/ApiEmptySentence.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tik4net.Api
{
internal class ApiEmptySentence : ApiReSentence, ITikDoneSentence
{
public ApiEmptySentence()
: base(Array.Empty<string>())
{
}

public string GetResponseWord()
{
return GetWordValue(TikSpecialProperties.Ret);
}

public string GetResponseWordOrDefault(string defaultValue)
{
return GetWordValueOrDefault(TikSpecialProperties.Ret, defaultValue);
}
}
}