mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
fixed NPE
This commit is contained in:
parent
e8b5f3a029
commit
6b68d31e47
2 changed files with 22 additions and 18 deletions
|
@ -298,12 +298,19 @@ public final class ScannerConfigUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IPath getDiscoveredScannerConfigStore(IProject project, boolean delete) {
|
public static IPath getDiscoveredScannerConfigStore(IProject project, boolean delete) {
|
||||||
if (project != null) {
|
String fileName = null;
|
||||||
try {
|
try {
|
||||||
String fileName = project.getPersistentProperty(discoveredScannerConfigFileNameProperty);
|
fileName = project.getPersistentProperty(discoveredScannerConfigFileNameProperty);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
MakeCorePlugin.log(e.getStatus());
|
||||||
|
}
|
||||||
if (fileName == null) {
|
if (fileName == null) {
|
||||||
fileName = String.valueOf(sRandom.nextLong()) + ".sc"; //$NON-NLS-1$
|
fileName = String.valueOf(sRandom.nextLong()) + ".sc"; //$NON-NLS-1$
|
||||||
|
try {
|
||||||
project.setPersistentProperty(discoveredScannerConfigFileNameProperty, fileName);
|
project.setPersistentProperty(discoveredScannerConfigFileNameProperty, fileName);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
MakeCorePlugin.log(e.getStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IPath path = MakeCorePlugin.getWorkingDirectory();
|
IPath path = MakeCorePlugin.getWorkingDirectory();
|
||||||
|
@ -315,10 +322,5 @@ public final class ScannerConfigUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
} catch (CoreException e) {
|
|
||||||
MakeCorePlugin.log(e.getStatus());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,8 +121,10 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC
|
||||||
public void removeDiscoveredInfo(IProject project) {
|
public void removeDiscoveredInfo(IProject project) {
|
||||||
ScannerConfigUtil.getDiscoveredScannerConfigStore(project, true);
|
ScannerConfigUtil.getDiscoveredScannerConfigStore(project, true);
|
||||||
DiscoveredPathInfo info = (DiscoveredPathInfo)fDiscoveredMap.remove(project);
|
DiscoveredPathInfo info = (DiscoveredPathInfo)fDiscoveredMap.remove(project);
|
||||||
|
if (info != null) {
|
||||||
fireUpdate(INFO_REMOVED, info);
|
fireUpdate(INFO_REMOVED, info);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void updateDiscoveredInfo(IDiscoveredPathInfo info) throws CoreException {
|
public void updateDiscoveredInfo(IDiscoveredPathInfo info) throws CoreException {
|
||||||
if (fDiscoveredMap.get(info.getProject()) != null) {
|
if (fDiscoveredMap.get(info.getProject()) != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue