Skip to content

Commit

Permalink
Take into account that we could have an error object in our result json
Browse files Browse the repository at this point in the history
  • Loading branch information
Toon Schoenmakers committed Mar 1, 2016
1 parent c3b0707 commit a25e650
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions errorresult.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class ErrorResult : public Php::Base
* Constructor
* @param output
*/
ErrorResult(const JSON::Object &output) : _json(output) {}
ErrorResult(const JSON::Object &output) : _json(output.isObject("error") ? output.object("error") : output) {}

/**
* Constructor
* @param output
*/
ErrorResult(const std::shared_ptr<JSON::Object> &output) : _json(*output) {}
ErrorResult(const std::shared_ptr<JSON::Object> &output) : ErrorResult(*output) {}

/**
* Destructor
Expand Down

0 comments on commit a25e650

Please sign in to comment.