修复 一些崩溃问题
This commit is contained in:
@@ -52,7 +52,10 @@ public class AutoJs extends com.stardust.autojs.AutoJs {
|
||||
}
|
||||
|
||||
|
||||
public static void initInstance(Application application) {
|
||||
public synchronized static void initInstance(Application application) {
|
||||
if (instance != null) {
|
||||
return;
|
||||
}
|
||||
instance = new AutoJs(application);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class JavaScriptHighlighter implements SimpleTextWatcher.AfterTextChanged
|
||||
}
|
||||
|
||||
public void addToken(int tokenStart, int tokenEnd, int color) {
|
||||
if(mCount < tokenStart){
|
||||
if (mCount < tokenStart) {
|
||||
int c = mCount > 0 ? colors[mCount - 1] : color;
|
||||
for (int i = mCount; i < tokenStart; i++) {
|
||||
colors[i] = c;
|
||||
@@ -93,10 +93,13 @@ public class JavaScriptHighlighter implements SimpleTextWatcher.AfterTextChanged
|
||||
}
|
||||
|
||||
public void updateTokens(String sourceString) {
|
||||
if(mTheme == null){
|
||||
if (mTheme == null) {
|
||||
return;
|
||||
}
|
||||
final int id = mRunningHighlighterId.incrementAndGet();
|
||||
if (mExecutorService.isShutdown() || mExecutorService.isTerminated() || mExecutorService.isTerminating()) {
|
||||
return;
|
||||
}
|
||||
mExecutorService.execute(() -> {
|
||||
try {
|
||||
mLogger.reset();
|
||||
|
||||
@@ -168,6 +168,9 @@ public class ExplorerView extends ThemeColorSwipeRefreshLayout implements SwipeR
|
||||
Stack<ScriptFile> dirs = new Stack<>();
|
||||
while (!dir.equals(root)) {
|
||||
dir = dir.getParentFile();
|
||||
if (dir == null) {
|
||||
break;
|
||||
}
|
||||
dirs.push(dir);
|
||||
}
|
||||
ExplorerDirPage parent = null;
|
||||
|
||||
@@ -117,7 +117,7 @@ public class CommunityFragment extends ViewPagerFragment implements BackPressedH
|
||||
|
||||
private boolean isInPostsPage() {
|
||||
String url = mWebView.getUrl();
|
||||
return url.matches(POSTS_PAGE_PATTERN);
|
||||
return url != null && url.matches(POSTS_PAGE_PATTERN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user