Added null check into getTransactions()