The cause of the issue is that the Document folders in the project have gotten messed-up, with multiple folders being listed as a 'root-folder' which is not allowed. So if you receive this error on the Test Case Details page:
Unable to cast object of type 'System.DBNull' to type 'System.String'.
Then the first thing to do is to run:
SELECT * FROM TST_PROJECT_ATTACHMENT_FOLDER WHERE PROJECT_ID = X
(where X is the ID of the project).
If you see multiple entries in the results with PARENT_PROJECT_ATTACHMENT_FOLDER_ID set to NULL then that is the cause of the issue. In which case, you need to set the PARENT_PROJECT_ATTACHMENT_FOLDER_ID for the second result to the real root project ID.
For example, if you have the following:
Then you'd run the following:
SET PARENT_PROJECT_ATTACHMENT_FOLDER_ID = 1
WHERE PROJECT_ATTACHMENT_FOLDER_ID = 15
and that would fix the issue.
If you are hosted by Inflectra, then just mention this article in the ticket along with the error message and the ID of the affected project, and a member of our support team will fix it for you.