Fix null pointer.

This commit is contained in:
James Cole
2018-03-11 08:22:20 +01:00
parent aad0864018
commit 7d6c8aa9dc
4 changed files with 10 additions and 15 deletions

View File

@@ -58,10 +58,12 @@ class TransactionJournalMetaFactory
}
if (strlen($value) === 0) {
// don't store blank strings.
try {
$entry->delete();
} catch (Exception $e) { // @codeCoverageIgnore
Log::error(sprintf('Could not delete transaction journal meta: %s', $e->getMessage())); // @codeCoverageIgnore
if (!is_null($entry)) {
try {
$entry->delete();
} catch (Exception $e) { // @codeCoverageIgnore
Log::error(sprintf('Could not delete transaction journal meta: %s', $e->getMessage())); // @codeCoverageIgnore
}
}
return null;