Skip to content

Commit c7fe851

Browse files
committed
Fix potential NPE
1 parent 15a92e9 commit c7fe851

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/symbols/internal/SymbolIconProviderRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ public static SymbolIconProvider getSymbolIconProviderFor(Object symbol) {
9999
private SymbolIconProvider getIconProvider(Object symbol) {
100100
URI uri = getUri(symbol);
101101
if (uri == null) {
102-
return null;
102+
return defaultIconProvider;
103103
}
104104

105105
String fileName = null;
106106
try {
107107
fileName = Path.of(uri.getPath()).getFileName().toString();
108108
} catch (Exception e) {
109109
Platform.getLog(getClass()).warn("Failed to parse file name from URI " + uri, e); //$NON-NLS-1$
110-
return null;
110+
return defaultIconProvider;
111111
}
112112

113113
IContentType[] contentTypes = Platform.getContentTypeManager().findContentTypesFor(fileName);

0 commit comments

Comments
 (0)