File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,27 @@ public void SetModel(TMModel model)
22
22
23
23
public void AddLine ( int line )
24
24
{
25
- this . list . Insert ( line , new ModelLine ( ) ) ;
25
+ lock ( mLock )
26
+ {
27
+ this . list . Insert ( line , new ModelLine ( ) ) ;
28
+ }
26
29
}
27
30
28
31
public void RemoveLine ( int line )
29
32
{
30
- this . list . RemoveAt ( line ) ;
33
+ lock ( mLock )
34
+ {
35
+ this . list . RemoveAt ( line ) ;
36
+ }
31
37
}
32
38
33
39
public ModelLine Get ( int index )
34
40
{
35
41
lock ( mLock )
36
42
{
43
+ if ( index < 0 || index >= this . list . Count )
44
+ return null ;
45
+
37
46
return this . list [ index ] ;
38
47
}
39
48
}
Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ void ThreadWorker()
94
94
continue ;
95
95
}
96
96
97
- if ( model . lines . Get ( toProcess ) . IsInvalid )
97
+ var modelLine = model . lines . Get ( toProcess ) ;
98
+
99
+ if ( modelLine != null && modelLine . IsInvalid )
98
100
{
99
101
try
100
102
{
You can’t perform that action at this time.
0 commit comments