Skip to content
Browse files

Added a check to make sure the exception is a valid struct.

  • Loading branch information...
1 parent cb7ecae commit e1645432675da6d2b4786ad90580ceafa1855705 nealerickson committed Nov 4, 2011
Showing with 10 additions and 3 deletions.
  1. +10 −3 loggr/Events.cfc
View
13 loggr/Events.cfc
@@ -32,13 +32,20 @@ Copyright 2011, Neal Erickson
<cfscript>
var loc = {};
- if (StructKeyExists(arguments.exception, "rootcause"))
+ if (IsStruct(arguments.exception))
{
- loc.exception = Duplicate(arguments.exception.rootcause);
+ if (StructKeyExists(arguments.exception, "rootcause"))
+ {
+ loc.exception = Duplicate(arguments.exception.rootcause);
+ }
+ else
+ {
+ loc.exception = Duplicate(arguments.exception);
+ }
}
else
{
- loc.exception = Duplicate(arguments.exception);
+ loc.exception = {};
}
loc.data = "<b>Error:</b> ";

0 comments on commit e164543

Please sign in to comment.
Something went wrong with that request. Please try again.