Skip to content

Commit d0a5485

Browse files
committed
Handling startPos and endPos in case they did not exist.
1 parent 947b6e5 commit d0a5485

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/FamixJavaModelUpdater/TFJMUEntityFactory.trait.st

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ TFJMUEntityFactory >> fileAnchorPath: anObject [
7676
{ #category : 'model - create' }
7777
TFJMUEntityFactory >> generateAnchorBasedOn: famixSourceAnchor for: aFastJavaEntity [
7878

79+
| safeStart |
80+
safeStart := self newStartPosition ifNil: [ 0 ].
81+
7982
^ (self create: FamixJavaIndexedFileAnchor)
80-
startPos: self newStartPosition + aFastJavaEntity startPos - 1 ;
81-
endPos: self newStartPosition + aFastJavaEntity endPos - 1 ;
82-
fileName: famixSourceAnchor fileName ;
83+
startPos: safeStart + aFastJavaEntity startPos - 1 ;
84+
endPos: safeStart + aFastJavaEntity endPos - 1 ;
85+
fileName: famixSourceAnchor ;
8386
yourself
8487
]
8588

0 commit comments

Comments
 (0)