1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Catch potential nullpointer exceptions.

This commit is contained in:
Alain Magloire 2002-10-19 19:19:11 +00:00
parent a02276b6ee
commit 5bd17656da

View file

@ -97,6 +97,9 @@ public class CTarget implements ICDITarget {
try { try {
mi.postCommand(select); mi.postCommand(select);
MIThreadSelectInfo info = select.getMIThreadSelectInfo(); MIThreadSelectInfo info = select.getMIThreadSelectInfo();
if (info == null) {
throw new CDIException("No Answer");
}
currentThreadId = info.getNewThreadId(); currentThreadId = info.getNewThreadId();
} catch (MIException e) { } catch (MIException e) {
throw new CDIException(e.getMessage()); throw new CDIException(e.getMessage());
@ -171,7 +174,12 @@ public class CTarget implements ICDITarget {
//MIThreadListIdsInfo info = tids.getMIThreadListIdsInfo(); //MIThreadListIdsInfo info = tids.getMIThreadListIdsInfo();
mi.postCommand(tids); mi.postCommand(tids);
MIInfoThreadsInfo info = tids.getMIInfoThreadsInfo(); MIInfoThreadsInfo info = tids.getMIInfoThreadsInfo();
int[] ids = info.getThreadIds(); int [] ids;
if (info == null) {
ids = new int[0];
} else {
ids = info.getThreadIds();
}
if (ids != null && ids.length > 0) { if (ids != null && ids.length > 0) {
cthreads = new CThread[ids.length]; cthreads = new CThread[ids.length];
// Ok that means it is a multiThreaded. // Ok that means it is a multiThreaded.