Added null check for portType and methods[methodname].output
Merge commit 'e5534815517a8a6ef195f80233829fbe047cf4a3' into npe_issue