diff options
author | Frederic Boisnard <fredericx.boisnard@intel.com> | 2012-02-16 17:11:49 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-10 17:15:02 +0100 |
commit | 19bb62917f765c3fa11d1d4c5f88c445e22f227a (patch) | |
tree | 0293b3fe7cbc706c9485725cac38cfcf7e602c6d /parameter/RuleParser.cpp | |
parent | 68808c650fc95660c9eb0d8f0bf97701b8076eb8 (diff) | |
download | external_parameter-framework-19bb62917f765c3fa11d1d4c5f88c445e22f227a.zip external_parameter-framework-19bb62917f765c3fa11d1d4c5f88c445e22f227a.tar.gz external_parameter-framework-19bb62917f765c3fa11d1d4c5f88c445e22f227a.tar.bz2 |
PFW: Fixed bug when entering empty rule
BZ: 24081
When entering an empty rule (composed of spaces), the PFW used to
crash.
Now an error message is displayed : "Syntax error, no rule found".
Change-Id: If3cb505f879d006309add46d5c7c4f47325af563
Reviewed-on: http://android.intel.com:8080/35613
Reviewed-by: Boisnard, FredericX <fredericx.boisnard@intel.com>
Reviewed-by: Denneulin, GuillaumeX <guillaumex.denneulin@intel.com>
Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com>
Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/RuleParser.cpp')
-rw-r--r-- | parameter/RuleParser.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/parameter/RuleParser.cpp b/parameter/RuleParser.cpp index b72556b..0258adf 100644 --- a/parameter/RuleParser.cpp +++ b/parameter/RuleParser.cpp @@ -121,8 +121,20 @@ bool CRuleParser::parse(CCompoundRule* pParentRule, string& strError) // Go on break; } - case EDone: - return true; + case EDone: { + // If the current state is EDone, check that at least one rule has been found. + if (_pRootRule) { + + // At least one rule found + return true; + } else { + + strError = "Syntax error, no rule found"; + + return false; + } + + } default: assert(0); return false; |