What do you really want to check here? If panel is undefined this will throw an exception (ReferenceError).