| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -804,17 +804,20 @@ bool SolveSpaceUI::ReloadAllImported(bool canCancel) | |||
| 804 | 804 | g->linkFile = newPath; | |
| 805 | 805 | } | |
| 806 | 806 | ||
| 807 | - std::string rel = PathSepUNIXToPlatform(g->linkFileRel); | ||
| 808 | - std::string fromRel = MakePathAbsolute(SS.saveFile, rel); | ||
| 809 | - FILE *test = ssfopen(fromRel, "rb"); | ||
| 810 | - if(test) { | ||
| 811 | - fclose(test); | ||
| 812 | - // Okay, exists; update the absolute path. | ||
| 813 | - g->linkFile = fromRel; | ||
| 814 | - } else { | ||
| 815 | - // It doesn't exist. Perhaps the file was moved but the tree wasn't, and we | ||
| 816 | - // can use the absolute filename to get us back. The relative path will be | ||
| 817 | - // updated below. | ||
| 807 | + // In a newly created group we only have an absolute path. | ||
| 808 | + if(!g->linkFileRel.empty()) { | ||
| 809 | + std::string rel = PathSepUNIXToPlatform(g->linkFileRel); | ||
| 810 | + std::string fromRel = MakePathAbsolute(SS.saveFile, rel); | ||
| 811 | + FILE *test = ssfopen(fromRel, "rb"); | ||
| 812 | + if(test) { | ||
| 813 | + fclose(test); | ||
| 814 | + // Okay, exists; update the absolute path. | ||
| 815 | + g->linkFile = fromRel; | ||
| 816 | + } else { | ||
| 817 | + // It doesn't exist. Perhaps the file was moved but the tree wasn't, and we | ||
| 818 | + // can use the absolute filename to get us back. The relative path will be | ||
| 819 | + // updated below. | ||
| 820 | + } | ||
| 818 | 821 | } | |
| 819 | 822 | ||
| 820 | 823 | try_load_file: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments