Commit e869881b by Tomas Hlavacek

Fix empty result exception in decorate dispatch

Fix possible exception in siuation when empty result is passed to decorateResult() methon of ulgmodel.
parent 2ca33e1c
......@@ -66,6 +66,7 @@ STRING_DETAILS = "Details of"
STRING_UNKNOWN = "(unknown)"
STRING_BGP_GRAPH='BGP graph'
STRING_BGP_GRAPH_ERROR='Error: Can not produce image out of the received output.'
STRING_EMPTY='empty'
# URL generator functions
def getASNURL(asn):
......
......@@ -323,6 +323,8 @@ class TextCommand(object):
pass
def decorateResult(self,session,decorator_helper=None):
if(session.getResult() == None):
return (decorator_helper.pre(defaults.STRING_EMPTY), 1)
if(session.getRange() != None and self.showRange()):
s = str.splitlines(session.getResult())
r=''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment