fix issue #12192 to return {} or error message
Merge pull request #12541 from crook/12192-fix

fix issue #12192 to return {} or error message