File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -50,16 +50,22 @@ public function importStatements( EntityDocument $entity ) {
5050 $ this ->logger ->info ( 'Adding statements: ' . $ entity ->getId ()->getSerialization () );
5151
5252 if ( !$ statements ->isEmpty () ) {
53- $ localId = $ this ->entityMappingStore ->getLocalId ( $ entity ->getId () );
54-
55- if ( !$ localId ) {
56- $ this ->logger ->error ( $ entity ->getId ()->getSerialization () . ' not found ' );
57- }
58-
59- try {
60- $ this ->addStatementList ( $ localId , $ statements );
61- } catch ( \Exception $ ex ) {
62- $ this ->logger ->error ( $ ex ->getMessage () );
53+ $ entityId = $ entity ->getId ();
54+
55+ if ( $ entityId instanceof EntityId ) {
56+ $ localId = $ this ->entityMappingStore ->getLocalId ( $ entityId );
57+
58+ if ( !$ localId ) {
59+ $ this ->logger ->error ( $ entityId ->getSerialization () . ' not found ' );
60+ }
61+
62+ try {
63+ $ this ->addStatementList ( $ localId , $ statements );
64+ } catch ( \Exception $ ex ) {
65+ $ this ->logger ->error ( $ ex ->getMessage () );
66+ }
67+ } else {
68+ $ this ->logger ->error ( 'EntityId not set for entity ' );
6369 }
6470 }
6571 }
You can’t perform that action at this time.
0 commit comments