/**
  * Returns a local variable in the given frame based on the the given name or <code>null</code> if
  * none.
  *
  * @return local variable or <code>null</code>
  */
 private IVariable findLocalVariable(IJavaScriptStackFrame frame, String variableName) {
   if (frame != null) {
     try {
       IVariable[] vars = frame.getVariables();
       for (int i = 0; i < vars.length; i++) {
         if (vars[i].getName().equals(variableName)) {
           return vars[i];
         }
       }
     } catch (DebugException x) {
       JavaScriptDebugUIPlugin.log(x);
     }
   }
   return null;
 }