<commit_before>import * as ab from 'asyncblock';
import { ElementFinder } from 'protractor';
import { ElementFinderSync } from './element-finder-sync';

export function exec(obj: any) {
  if (obj.then) {
    const flow = ab.getCurrentFlow();

    if (flow == null) {
      throw new Error('Could not find the current asyncblock flow. Please make sure this method is called from an asyncblock context.');<commit_msg>Prevent a null reference exception in exec<commit_after>import * as ab from 'asyncblock';
import { ElementFinder } from 'protractor';
import { ElementFinderSync } from './element-finder-sync';

export function exec(obj: any) {
  if (obj && obj.then) {
    const flow = ab.getCurrentFlow();

    if (flow == null) {
      throw new Error('Could not find the current asyncblock flow. Please make sure this method is called from an asyncblock context.');
{'fraction_non_alphanumeric': 0.10854503464203233, 'fraction_numerical': 0.0, 'mean_word_length': 4.1301775147929, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '592512', 'n_tokens_mistral': 234, 'n_tokens_neox': 237, 'n_words': 96}